title: Java Scanner break waiting for input
body: <p>How to break waiting for input in Java? </p>
  
  <pre><code>        Scanner s = new Scanner() ;
          s.nextInt();
          //here break without input
  </code></pre>
  
  <p>I want to create while loop where you can Input something for 5min.  after 5min loop should be break.  but when time is left,  loop wont do again but scanner is still wait for input and enter.  </p>
  
  <p>I want to exit from waiting for input, I dont mean break while loop. </p>