title: System.out.println not working for string
body: <p>I'm trying to learn Java through Hackerrank and the challenge that I'm working on currently takes an int, double, and string and prints them on separate lines in reverse order, but I haven't been able to get the string to print.</p>
  
  <pre><code>import java.util.Scanner;
  
  public class Solution {
  
      public static void main(String[] args) {
              Scanner sc=new Scanner(System.in);
              int x=sc.nextInt();
              double y=sc.nextDouble();
              String s=sc.nextLine();
  
              System.out.println("String: "+s);
              System.out.println("Double: "+y);
              System.out.println("Int: "+x);
           }
      }
  </code></pre>
  
  <p>The input is:</p>
  
  <pre><code>42
  3.1415
  Welcome to Hackerrank Java tutorials!
  </code></pre>
  
  <p>And output is:</p>
  
  <pre><code>String:
  Double: 3.1415
  Int: 42
  </code></pre>
  
  <p>I don't know Java at all, but from the code I've seen online, I can't tell why this is wrong.</p>