title: Using scanner to read input statement
body: <p>i'm writing code to read simple statement of words like "one two three", and put each word into an array String [] token, i wanted to input the statement using Scanner but it only read the first word. 
  when i use the main method to input the statement it works well. 
  can i know what is my mistake?</p>
  
  <p>here are the 2 Codes:</p>
  
  <p>//Using main method:</p>
  
  <pre><code>public class MyLangyage {
      public static void main(String[] args) {
          String statement = "one two three";
          screen(statement);
      }
      public static void screen(String statement) {
          String token[]= statement.split(" ");
  
          for (int i = 0; i &lt; token.length; i++) {
              System.out.println(token[i]);
          }
      }
  }
  </code></pre>
  
  <p>the result at the console will be:</p>
  
  <p><em>one
  two
  three</em></p>
  
  <p>//Using The Scanner:</p>
  
  <pre><code>import java.util.Scanner;
  
  public class MyLangyage {
      public static void main(String[] args) {
          Scanner scanner = new Scanner(System.in);
          String statement = scanner.next();
          screen(statement);
      }
      public static void screen(String statement) {
          String token[]= statement.split(" ");
  
          for (int i = 0; i &lt; token.length; i++) {
              System.out.println(token[i]);
          }
      }
  }
  </code></pre>
  
  <p>if i write at console: </p>
  
  <p><em>one two three</em></p>
  
  <p>then press enter the result will be:</p>
  
  <p><em>one</em></p>