title: user input `nextLine` and `nextInt` order
body: <p>Below are two scripts that only differ in the order the user is asked for input. Script #1 works, whereas Script #2 doesn't work as expected.
  In Script #1 I ask the <code>name</code> question first, then the <code>age</code> question.
  In Script #2 I ask the <code>age</code>  question first, then the <code>name</code> question. </p>
  
  <p>Script #1 (works):</p>
  
  <pre><code>import java.util.Scanner;
  
  public class Example2 {
      public static void main(String[] args) {
          // Initiate a new Scanner
          Scanner userInputScanner = new Scanner(System.in);
  
          // Name Question
          System.out.print("\nWhat is your name? ");
          String name = userInputScanner.nextLine();
  
          // Age Question
          System.out.print("How old are you?");
          int age = userInputScanner.nextInt();
  
          System.out.println("\nHello " + name + ". You are " + age
                  + " years old");
      }
  }
  </code></pre>
  
  <p>Script #2 (doesn't work):</p>
  
  <pre><code>import java.util.Scanner;
  
  public class Example2 {
      public static void main(String[] args) {
          // Initiate a new Scanner
          Scanner userInputScanner = new Scanner(System.in);
  
          // Age Question
          System.out.print("How old are you?");
          int age = userInputScanner.nextInt();
  
          // Name Question
          System.out.print("\nWhat is your name? ");
          String name = userInputScanner.nextLine();
  
  
          System.out.println("\nHello " + name + ". You are " + age
                  + " years old");
      }
  }
  </code></pre>
  
  <p>in Script #2, After the user enters <code>age</code>, he/she gets the following printed to console:</p>
  
  <pre><code>What is your name? 
  Hello . You are 28 years old
  </code></pre>
  
  <p>And then the script ends, without allowing him/her to enter a <code>name</code></p>
  
  <p>My question:
  Why doesn't script #2 work?
  What can I do to get script #2 to work (while maintaining order of inputs)</p>