例题如下:
public class char1 {
public static void main(String[] args) {
char c=0;
System.out.print("enter a character:");
try{
c=(char)System.in.read();
}catch(IOException e){};
if (c>=65 && c>=97 && c<=122)
System.out.println("it is a letter.the letter is:"+c);
else
System.out.println("it's not a letter.");
}
}
请问高手,catch(IOException e){};是什么意思?
public class char1 {
public static void main(String[] args) {
char c=0;
System.out.print("enter a character:");
try{
c=(char)System.in.read();
}catch(IOException e){};
if (c>=65 && c>=97 && c<=122)
System.out.println("it is a letter.the letter is:"+c);
else
System.out.println("it's not a letter.");
}
}
请问高手,catch(IOException e){};是什么意思?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货