I am preparing for my OCP v8 exam. I am just playing with writing simple programs. So I wrote a basic console calculator program. I made all my methods are static for my convience. I am getting a runtime exception.
Don't be afraid of size of the program. Anyone can understand it. Try it and help me to figure out what is wrong here. Cheers!
Here is the exception that is getting logged in my Eclipse console IDE
In your readTextLine, when you read a line, you are closing the System.in stream by closing the BufferedReader (which gets closed because of try-with-resources block). So, for the next line, you get that exception.
By the way, when you get stacktrace, it shows the line numbers - which you can use to pinpoint the code causing the exception.