A.E$1.class是接口匿名类的字节码文件(编译器给匿名类的名字是E$1)。
B.E.class是接口匿名类的字节码文件。
C.HelloMachine.class是接口匿名类的字节码文件。
D.SpeakHello.class是接口匿名类的字节码文件。
第1题
1)classBaseClass
2)publicStringstr;
3)publicBaseClass()
4)System.out.println(“ok”);
5)publicBaseClass(Strings)
6)str=s;}}
7)classSubClassextendsBaseClass8)}
9)publicclassExample{
10)publicvoidmethod(){
11)SubClasss=newSubClass(“hello”);
12)BaseClassb=newBaseClass(“world”);
13)}
14)}
A、7
B、10
C、11
D、12
第2题
A.Classawillnotcompile.
B.Line46canthrowtheuncheckedexceptionTestException.
C.Line45canthrowtheuncheckedexceptionTestException.
D.Line46willcompileiftheenclosingmethodthrowsaTestException.
E.Line46willcompileifenclosedinatryblock,whereTestExceptioniscaught.
第3题
A.20,20
B.Hello World!
C.编译不能通过
D.以上都不对
第4题
A.Thecodewillnotcompile.
B.AWindowwillappearcontainingonlyaButton.
C.AnIllegalArgumentExceptionisthrownatline6.
D.AWindowbuttonwillappearbutwillnotcontaintheLabel,TextField,orButton.
E.AWindowwillappearcontainingaLabelatthetop,aTextFieldbelowtheLabel,andaButtonbelowtheTextField.
F.AWindowwillappearcontainingaLabelontheleft,aTextFieldtotherightoftheLabel,andabuttontotherightoftheTextField.
第5题
A.1
B.2
C.Compilation fails.
D.The code runs with no output.
E.An exception is thrown at runtime.
第6题
Public void test(){
Try{
sayHello();
system.out.println( “ hello ” );
} catch (ArrayIndexOutOfBoundException e) {
System.out.println( “ ArrayIndexOutOfBoundException ” );
}catch(Exception e){
System.out.println( “ Exception ” );
}finally {
System.out.println( “ finally ” );
}
}
如果 sayHello( ) 方法正常运行,则 test( ) 方法的运行结果将是
A) Hello
B) ArrayIndexOutOfBondsException
C) Exception
Finally
D) Hello
Finally
第7题
A.Hello
B.ArraylndexOutOfBondsException
C.Exception Finally
D.Hello Finally
第8题
A.Hello
B.ArraylndexOutOfBondsException
C.Exception Finally
D.Hello Finally
第9题
A.s.equals(t);
B.Lequals(c);
C.s==t;
D.t==c;
第10题
Public void test{
Try{
sayHello;
system.out.println("hello"):
}catch(ArraylndexOutOfBoundException e){
System.out.println("ArraylndexOutOfBoundExcep—
tion");
}catch(Exception e){
System.out.println("Exception"):
}finally{
System.Out.println("finally");
}
}
如果sayHello方法正常运行,则test方法的运行结果将是( )。
A.Hello
B.ArraylndexOutOfBondsException
C.ExceptionFinally
D.HelloFinally
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!