title: How to input a sentence in Java
body: <p>The code I have written takes as input just a single string and not a whole sentence and I want a whole sentence to be taken as input:</p>
  
  <pre class="lang-java prettyprint-override"><code>import java.util.Scanner;
  
  public class Solution {
  
      public static void main(String[] args) {
          Scanner scan = new Scanner(System.in);
          int i; 
          i= scan.nextInt();
          double d;
          d=scan.nextDouble();
          String s;
          s=scan.next();
          System.out.println("String: " + s);
          System.out.println("Double: " + d);
          System.out.println("Int: " + i);
      }
  }
  </code></pre>
  
  <p>The test case is "Welcome to Java" and it's just showing "Welcome" in the output. Everything else is working fine. Please help. </p>