Java软件开发练习题
12、为了将HelloApplet(主类名为HelloApplet.class)嵌入在greeting.html文件中,应该在下列greeting.html文件的横线处填入的代码是
A)HelloApplet.class
B)CODE=” HelloApplet.class”
C)CODE=” HelloApplet.class” WIDTH=150 HEIGHT=25
D)CODE=” HelloApplet.class” WIDTH=10 HEIGHT=10
13、下列变量名的定义中,符合Java命名约定的是
A)fieldname
B)super
C)Intnum
D)$number
14、自定义异常类的父类可以是
A)Error
B)VirtuaMachineError
C)Exception
D)Thread
15、阅读下列程序片段
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