Imagine the following scanario: I have a program which ask for an integer input, followed by a String input.
int age=0; String name; Scanner sc = new Scanne
This must work perfectly. I tested it out.
int age=0; String name; Scanner sc = new Scanner(System.in); System.out.print("Enter Age: "); age = sc.nextInt(); System.out.print("Enter Name: "); name= sc.nextLine();