lundi 17 novembre 2014

NoSuchElementException after closing system.in


Vote count:

0




[ Interrupt a thread waiting for user input and then exit the app ]


I wanted to do the same exercise as mentioned in the above link. But, I ran into NoSuchElementException when I tried to use inConsole.nextLine(), after successfully closing BufferedReader object, in spite of reassigning inConsole like inConsole = new Scanner(System.in) to read from Standard input.


After closing BufferedReader object, can't I reassign to Scanner object like above and use it?



asked 25 secs ago







NoSuchElementException after closing system.in

Aucun commentaire:

Enregistrer un commentaire