import java.util.*;
import java.io.*;
public class wo{

public static void main(String arg[]){  BufferedReader in  = new BufferedReader(new InputStreamReader(System.in));
int i = Integer.parseInt(in.readLine());

}
错误是Unhandled exception type IOException
是这里in.readLine()
这是什么问题啊?

解决方案 »

  1.   

    IOException没有处理public static void main(String arg[]) throws Exception
    {  BufferedReader in  = new BufferedReader(new InputStreamReader(System.in));
    int i = Integer.parseInt(in.readLine());
    }
      

  2.   

    public static void main(String arg[]) throws Exception

             try{
    BufferedReader in  = new BufferedReader(new InputStreamReader(System.in));
    int i = Integer.parseInt(in.readLine());
             }
             catch(IOException e)
             {
                 //Error Handle....
             }
    }
      

  3.   

    哦,第二个就去掉public static void main(String arg[]) throws Exception后面的throws Exception:)