title: user input string and integers in Java
body: <pre><code>    System.out.print("Name : ");
      String name = in.nextLine();
  
      System.out.print("Age : ");
      int age = in.nextInt();
  
      System.out.print("City : ");
      String city = in.nextLine();
  </code></pre>
  
  <p>the output will be : </p>
  
  <p>Name : test</p>
  
  <p>Age : 20</p>
  
  <p>BUILD SUCCESSFUL</p>
  
  <p>when i debug them, it won't read the user input for "city" . but when i changed the data type for "age" to string, it will read. how can i kept the data type of age to int with the system reading the user inputs for city ? </p>