0
Why do i need to throw exception here
In the code when i remove throws Exception it won't compile. Plis tell me the specific reason. I mean which line requires the exception to be thrown. Thank you https://code.sololearn.com/c7xj5SK1w4CW/?ref=app
1 Answer
+ 4
BufferedReader.readLine() throws an IOException
You need to wrap these calls in a try catch to handle them or throw the exception up the call stack.
https://docs.oracle.com/javase/8/docs/api/java/io/BufferedReader.html