I'm talking about efficiency. I need to read an int from the console input. I know for sure that the input is the form of one int on each line and no other values.
I have a Scanner object defined:
Scanner scan = new Scanner(System.in);
I can either do:
int a = scan.nextInt();
or
int a = Integer.parseInt(scan.nextLine());
Which way is better?