title: Shorten Code in Java when creating objects
body: <p>Im just wondering if there is a nice shortcut in creating a Scanner object, getting user input and storing it into a variable. cheers</p>
  
  <p>my crappy long code:</p>
  
  <pre><code>String userInput;
  
  public String getUserInput(){
      Scanner UI= new Scanner(System.in);
      userInput = UI.nextLine();
      return userInput;
  }
  </code></pre>