Although you correctly used the code tags, that code is surprisingly difficult to read. And I am not quite sure what your question means. I think you need to go back a stage. There is a bit of hardware getting between you and the solution. It is a black wire between the wall and your computer. Remove that, then try with a sheet of paper. Read carefully what Scanner#hasNext() does, and see if you can work out any circumstances in which it might return false when you are using the keyboard. You appear to be using the input as an int, so why don’t you look for a method which keeps returning true until you don’t have an int? Or what about a while loop instead of the do looP? Somebody else had similar problems, so you can see you can terminate your loop by writing stop.
Joined: Dec 19, 2012
hmm ı understand. can you say how ı can do that exit to loop when ı press enter.
hayri hocaoglu wrote:ı want to remove this question because of wrong question
It's very confusing when somebody posts a question, and then other people talk about it, and then the original poster deletes the question. It just makes the thread look incoherent. So we don't really like it when that happens.
But if the question was wrong, then no problem... just say so, ask the right question, and the thread can continue.