0

I am doing a exercise of a banking account with a txt file, my acount have name(String), acc number(String), balance(double). I need to convert the balance (column[2]) in to a double.

public static ArrayList<Account> readAccounts(Scanner input){
    String row;
    String[] column;
    ArrayList<Account> accounts = new ArrayList<>();
    while(input.hasNext()){
        row = input.nextLine();
        column = row.split(";");
        Account account = new Account(column[0], column[1], column[2]);
        account.toString();
        accounts.add(account);
    }
    return accounts;
}
Rgt
  • 1
  • 1

0 Answers0