title: Scanner Wont read strings even though I used the correct .NextLine()
body: <p>I am coding a problem for elapsed time and need some help testing to see if the user inputs am or pm. I went to use .equalsIgnoreCase(); on my string and discovered it did not store it. Here is my code</p>
  
  <pre><code>public static void elapsedTime()
  {
      Scanner reader = new Scanner (System.in);
  
      System.out.print("Enter the beginning hour: ");
      int startingHour = reader.nextInt();
  
      System.out.print("Enter the beginning minute(s): ");
      int startingMinutes = reader.nextInt();
      reader.nextLine();
  
      System.out.print("Enter AM/PM: ");
      String startingAmOrPm = reader.nextLine();
  
  
      System.out.print("Enter the ending hour: ");
      int endingHour = reader.nextInt();
  
      System.out.print("Enter the ending minute(s): ");
      int endingMinutes = reader.nextInt();
  
      System.out.print("Enter AM/PM:  ");
      String endingAmOrPm = reader.nextLine();
      reader.nextLine();
  
  
  
      System.out.println("");
  }
  </code></pre>
  
  <p>As I researched I discovered the reader.NextLine() but that didnt help the string not having a value. Can anybody help? Id appreciate it!</p>