s=in.readLine() 这个方法要抛出IOException
你或者如下写main()
public static void main(String[] args) throws IOException
或者用
try{
...
s = in.readLine();
...
}
catch(IOException e){
//处理Exception
}
你或者如下写main()
public static void main(String[] args) throws IOException
或者用
try{
...
s = in.readLine();
...
}
catch(IOException e){
//处理Exception
}
已经说得很清楚了,楼主仔细看看,同意楼上