Hi, I'm fairly new to java and am trying to write a form of banking system for a college assignment. At the moment I am trying to access the account number of the object userCurrentAccount with it's method getAccountNumber from the account class.
This is where the object is created and gets the account number and balance set:
CurrentAccount userCurrentAccount = new CurrentAccount(); userCurrentAccount.setCABalance(fileCurrentAccountBalance); userCurrentAccount.setAccountNumber(fileCurrentAccountNum);
In the separate jFrame form I currently have this code but I get an error saying 'cannot find variable' regarding userCurrentAccount:
String accnum; accnum = userCurrentAccount.getAccountNumber();
Any help greatly appreciated.