title: Read multiple word strings with java.util.Scanner()
body: <p>I want to read a full name in from the console using java.util.Scanner() and assign that value to a string.</p>
  
  <p>for example;</p>
  
  <p>Type "John Smith" in console. Hit return and
  String s = "John Smith";</p>
  
  <p>I tried writing a readString method to do this but its getting loop locked. Does anyone know a soloution?.</p>
  
  <p><em>part of my code.</em></p>
  
  <pre><code>System.out.println("Name: ");
  String name = readString();
  </code></pre>
  
  <p><em>and my broken method.</em></p>
  
  <pre><code>private String readString()
  {
      String s ="";
      while(scanner.hasNext())
      s += scanner.next();   
      return s;
  } 
  </code></pre>