hasNext() – when does it block and why?
There is a difference between testing via Console or via TextFile. If I read from Console the program expects a Stream and it will wait for further Input. When testing via Input from Textfile (still with System.in for the Scanner, using Java Program ) the hasNext() will return false at the end of the file … Read more