单项选择题
有如下代码段 public class OperatorAndExceptions { public static void main(String args[]) { int i=10,j=15; System.out.println(i==j); String s1=new String("how are you!"); String s2=new String("how are you!"); System.out.println(s1==s2); } } 其输出为( )。
A.true false
B.true true
C.false true
D.false false
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
有如下的代码段,当编译和运行时,下列各选项中说法正确的是( )。 public class Z { public static void main(String args[]) { new Z(); } Z() { Z aliasl=this; Z alias2=this; synchronized(aliasl) { try{ alias2.walt(); System.out.println( DONE WAITING ); } catch(InterruptedException e) { System.out.println( INTERR UPTED ); } catch (Exception e) { System.out.println( OTHER EXCEPTION ); } finally{ System.out.println( FINALLY ); } } System.out.println( ALL DONE ); } }
A.应用程序编译正常,但是不打印任何数据
B.应用程序编译正常,并打印数据“DONE WAITING”
C.应用程序编译正常,并打印数据“FINALLY”
D.应用程序编译正常,并打印数据“ALL DONE”
点击查看答案&解析
单项选择题
下列程序的运行结果是( )。 public class Sun { public static void main(String args[]) { int a=1; int b=1; for(int i=1;i<=3;i++) { a=a+b; b=b+a; } System.out.println(a+ +b); } }
A.66
B.5 8
C.13 21
D.34 55
点击查看答案&解析
相关试题
下列JApplet使用重写paintComponet()方法...
现在有Java Applet小程序的源程序文件MyAp...
任何非空树中有且仅有—个结点没有前驱结点...
编写同时具有Applet与Application特征的程...
有如下代码片段,请在画线处填入正确的代码...