title: Why string inputs after integer input gets skipped in Java?
body: <p>I am trying to input values of certain string and integer variables in Java.
  But if I am taking the input of string after the integer, in the console the string input is just skipped and moves to the next input.</p>
  
  <p>Here is the code</p>
  
  <pre><code>String name1;
  int id1,age1;
  
  Scanner in = new Scanner(System.in);
  
  //I can input name if input is before all integers
  
  System.out.println("Enter id");
  id1 = in.nextInt();
  
  
  System.out.println("Enter name");       //Problem here, name input gets skipped
  name1 = in.nextLine();
  
  System.out.println("Enter age");
  age1 = in.nextInt();
  </code></pre>