title: .nextLine() method does not take subsequent String inputs
body: <p>I have a program that asks the user for an input of numbers and characters. For this I am using a <code>Scanner</code> class. But when I take two subsequent string inputs, the console just moves and asks the user to input the second string. The user is unable to input the first string. I have attached my code below to be more specific.</p>
  
  <pre><code>import java.util.Scanner;
  
  class XYZ {
  
      public static void main(String args[]) {
          int x, y, z, b, c;
          String p, q;
          Scanner sc = new Scanner(System.in);
  
          System.out.println("Enter a number");
          b = sc.nextInt();
  
          System.out.println("Enter a new number");
          c = sc.nextInt();
  
          System.out.println("Enter a String");
          p = sc.nextLine();
  
          System.out.println("Enter a new String");
          q = sc.nextLine();
  
          System.out.println("Enter a number");
          x = sc.nextInt();
  
          System.out.println("Enter 2nd number");
          y = sc.nextInt();
  
          System.out.println("Enter 3rd number");
          z = sc.nextInt();
  
          ABC a = new ABC();
  
          a.PQR(b, c);
          a.PQR(p, q);
          a.PQR(x, y, z);
      }
  }
  
  class ABC {
  
      void PQR(int a, int b) {
          int res = a + b;
          System.out.println("The sum is" + " " + res);
      }
  
      void PQR(String a, String b) {
          System.out.println("Thye concataneted string is" + a + " " + b);
      }
  
      void PQR(int a, int b, int c) {
          int res = a * b * c;
          System.out.println("The product is" + " " + res);
      }
  }
  </code></pre>