为啥编译的时候说没有定义过s,难道经过异常处理后这个定义会失效?public class Input{ public static void main(String args[]){
int s;
try{s=System.in.read();
}
catch(IOException e){
System.out.println("error");
}
System.out.print(s);
}
}
int s;
try{s=System.in.read();
}
catch(IOException e){
System.out.println("error");
}
System.out.print(s);
}
}
但是catch(IOException e)地方会出错误
我把它改成了Exception 结果 就没有什么错误了
我也是新手 但是我觉得S的定义没有什么错误
int s = 0;