A、执行时才可以知道 B、应用程序编译时能够判断 C、程序员编写程序时就已知道 D、永远不会知道 25、下列关于接口的描述,错误的是?() A、接口不是Object类的子类 B、一个接口只能继承一个接口 C、一个接口可以继承多个接口 D、接口不能被实例化 26、请阅读下面的程序 class WhileDemo4 { public static void main(String[] args) { int n = 5; while (n > 10) { System.out.print(n); n++; }
} } 下列选项中,哪一个是程序运行的结果 A、无输出 B、输出56789 C、死循环 D、编译错误 27、下列程序运行结果是() public class Demo { public static void main(String[] args) { Object obj=new Father(){ public void show(){ System.out.println(\} }; obj.show(); }
}
class Father{
public void show(){
System.out.println(\
}
}
A、hello father
B、helloworld
C、无结果
D、程序编译报错
28、public class Example {
public static void main(String[] args) {
try{
int rst = 4/0;
System.out.println(\
}catch(Exception e){
System.out.println(\语句块执行\
return;
}finally{
System.out.println(\语句块执行\
}
System.out.println(\程序继续向下执行\
}
}
运行以上程序,输出的结果是()
A、catch语句块执行
B、catch语句块执行程序继续向下执行
C、catch语句块执行finally语句块执行
D、0 程序继续向下执行
29、下列转义字符中,不合法的是()
A、'\\n'
B、'\\x'
C、'\\r'
D、'\\t'
相关推荐: