title: How to create a timer in java
body: <p>I want to create a timer, given a set amount of time the user has to answer the question within the allotted time, if he/she fails to do so, the user no longer has the option to enter  the answer </p>
  
  <p>I've tried timer. I need a separate thread to check in if the allotted time is up and then exit the loop.</p>