单项选择题
分析下列代码:
Class A{
Public static void main(String[] args){
method(); }
static void method(){
try{
System.out.println("Hello"); }finally{
System.out.println("good-bye"); } } }
编译运行后,输出结果是()。
A."Hello"
B."good-bye"
C."Hello""god-bye"
D.代码不能编译
相关考题
-
单项选择题
在实体Bean的生命周期中,只有在()方法成功完成后,ejbPostCreate()方法才能调用
A.ejbActivate()
B.ejvPassivate()
C.ejbCreate()
D.ejcRemove() -
单项选择题
在J2ee中,myWebApp目录是一个Web应用程序根目录,当在浏览器中输入http://localhost:8080/myWebApp/时,会自动打开该目录下的start.jsp文件。为了达到这个要求,需要在web.xml中添加如下代码()。
A.<welcome-file>start.jsp</welcome-file>
B.<welcome-file-list>start.jsp</welcome-file-list>
C.<welcome-list> <welcome-file>start.jsp</welcome-file> </welcome-list>
D.<welcome-file-list> <welcome-file>start.jsp</welcome-file> </welcome-file-list> -
单项选择题
在J2ee中,在、mySample.java中包含代码: System.out.println((InetAddress.getByName("aaaa")).getHostAddress()),但在网络上没有 aaaa这台主机。那么该行代码会()。
A.编译运行后什么也不显示
B.编译运行后显示“aaaa”字符文本
C.编译不能通过
D.编译运行后会跑出java.net.UnknownHostException异常
