import java.io.*;
class AccountInfo {
private String lastName;
private String firstName;
private int age;
private float accountBalance;
1. I think the value returned from br.readLine()
is null.
2. So it can NOT be converted from String to Integer.
3. Thats the reason you are getting NumberFormatException
4. To handle this, Wrap that code into try/catch
block.
try{
age = Integer.parseInt(br.readLine());
}catch(NumberFormatException ex){
System.out.println("Error occured with during conversion");
}