I가 다음과 같은 간단한 코드 :"처리되지 않은 예외 유형 IOException"이 나타나는 이유는 무엇입니까?
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);
}
}
}
내가받을 다음과 같은 오류 메시지가
----------
1. ERROR in io.java (at line 10)
while ((userInput = stdIn.readLine()) != null) {
^^^^^^^^^^^^^^^^
Unhandled exception type IOException
----------
1 problem (1 error)[email protected]:~/work/java$ mcedit io.java
이 사람이 왜 어떤 아이디어가 있습니까? 방금 요약 웹 사이트 (here)에 주어진 코드를 단순화하려고했습니다. 나는 지나치게 단순화 시켰는가? 당신은 추가해야