Scanner in = new Scanner(System.in);
for (int i = 1; i <= 6; i++) {
System.out.print("Name: ");
in.nextLine();
System.out.print("Age: ");
in.nextInt()
}
I expect the output of:
Name: David Obama
Age: 14
Name: Ava Omidi
Age: 53
etc.
but this is my output and only once nextLine() is used:
Name: David Obama
Age: 14
Name: Age: