How to stop waiting for user input?
I'm building a programm to ask multiplication and I want to set up a timer to force the person to give its answer in a given time : if the person answers before the end of the timer : go next multiplication if the timer reach its end, stop waiting user input : go next multiplication For the moment, case 1 can be done, but 2 not, I was thinking about a way to return; from the method within like a Thread or something, bu I don't know how So I'm facing a problem, if a Scanner is open, waiting for input, how to stop it ? I've tried putting it in a Thread and interrupt() it or using boolean as