java.util.NoSuchElementException – Scanner reading user input
This has really puzzled me for a while but this is what I found in the end. When you call, sc.close() in first method, it not only closes your scanner but closes your System.in input stream as well. You can verify it by printing its status at very top of the second method as : … Read more