I called a scanned object, using same object I am trying to take from user a int and a string.
Scanner scan = new Scanner(System.in);
//for a int
int first_value = scan.nextInt();
System.out.println(first_value);
//for a string
String first_name = scan.nextLine();
System.out.println(first_name);
Here console not waiting for string but If I use another object then it's working fine.
Scanner insert = new Scanner(System.in);
String name = insert.nextLine();
Is it possible to get int and string using same Scanner object ?