Why do I get the “Unhandled exception type IOException”?
问题 I have the following simple code: import java.io.*; class IO { public static void main(String[] args) { BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in)); String userInput; while ((userInput = stdIn.readLine()) != null) { System.out.println(userInput); } } } And I get the following error message: ---------- 1. ERROR in io.java (at line 10) while ((userInput = stdIn.readLine()) != null) { ^^^^^^^^^^^^^^^^ Unhandled exception type IOException ---------- 1 problem (1