Associate
- Joined
- 6 Dec 2007
- Posts
- 2,103
Hey all, am getting the above exception in my uni project. Does it mean that it can't find the end of the text file that is being read in? And how do I sort it?
The offending code is:
while (anAccountNumber != "****" && activeAccounts < MAX_ACCOUNTS)
{
anAccountName = Text.readLine(accountsFileIn);
aBalance = Text.readDouble(accountsFileIn);
accountDetails [activeAccounts] = new BankAccount(anAccountNumber, anAccountName, aBalance);
activeAccounts++;
anAccountNumber = Text.readLine(accountsFileIn);
}
and:
public static void main ( String [] args ) throws IOException{
ATM anATM = new ATM();
anATM.bank.loadAccountDetails(ACCOUNT_FILENAME_IN);
}//main
If I'm being vague, please tell me and I will post more info. Thanks!
The offending code is:
while (anAccountNumber != "****" && activeAccounts < MAX_ACCOUNTS)
{
anAccountName = Text.readLine(accountsFileIn);
aBalance = Text.readDouble(accountsFileIn);
accountDetails [activeAccounts] = new BankAccount(anAccountNumber, anAccountName, aBalance);
activeAccounts++;
anAccountNumber = Text.readLine(accountsFileIn);
}
and:
public static void main ( String [] args ) throws IOException{
ATM anATM = new ATM();
anATM.bank.loadAccountDetails(ACCOUNT_FILENAME_IN);
}//main
If I'm being vague, please tell me and I will post more info. Thanks!