题目内容

(专升本)一个异常处理中 finally语句块只能有一个或者可以没有。

A. 对
B. 错

查看答案
更多问题

看程序写出运行结果:public class Small{public static void main( String[] args ){Small t = new Small( );int b = t. get( );System.out.println(b);}public int get( ){try{return 1;}finally{return 2;}}}

写出程序运行结果:public class Demo{public static void main(String[] args){String str = null;try{if( str.length( ) == 0){System.out.print("The");}System.out.print(" Cow");}catch (Exception e ){System.out.print(" and");System.exit( 0 );}finally{System.out.print(" Chicken");}System.out.print(" show");}}

(1+X)假设 C 是抽象类,I1 和 I2 是接口。下列关于抽象类或接口的定义,哪一个是正确的( )。

A. public class A extends C implements I1,I2{}
B. public class A extends I1,I2 implements C{}
C. public class A implements I1,I2 extends C {}
D. public class A extends C, I1, I2 {}

(1+X)下列关于接口的描述正确的是( )。

A. 接口中可以有普通方法
B. 接口中可以定义局部变量
C. 接口不能继承多个父接口
D. 接口中“变量”实际表示的是常量

答案查题题库