enter image description hereI have written a file writer and a file reader class in which you put data into and use it by file reader in another class methods. The type of my variable defined in Account class is integer.To write it in file, I change the type as String(because I have my other variables as String)...when I want to use that variable in my method in Account class, I can not compare it with the local variable(which is filled by user).It gives me a "NullPointerException" error. Can anyone help me with this?(The code is just a summary)enter image description here
public class Account {
int PIN;
public void meth_name(){
int pin;
if(PIN == pin)
}
}
public class filewriter {
public void met_name(){
....
fw.write("PIN: "+ Integer.toString(PIN));
}
}