网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

publicclassThreads2implementsRunnable{publicvoidnun(){System.out.println(”run.”);thrownewRuntimeException(”Problem”);}publicstaticvoidmain(String[]args){Threadt=newThread(newThreads2());t.start();System.out.println(”Endofmethod.”);}}Whichtwocanberesults?()

A.java.lang.RuntimeException:Problem

B.run. java.lang.RuntimeException:Problem

C.Endofmethod. java.lang.RuntimeException:Problem

D.Endofmethod. run.java.lang.RuntimeException:Problem

E.run. java.lang.RuntimeException:ProblemEndofmethod.


参考答案

更多 “ publicclassThreads2implementsRunnable{publicvoidnun(){System.out.println(”run.”);thrownewRuntimeException(”Problem”);}publicstaticvoidmain(String[]args){Threadt=newThread(newThreads2());t.start();System.out.println(”Endofmethod.”);}}Whichtwocanberesults?()A.java.lang.RuntimeException:ProblemB.run. java.lang.RuntimeException:ProblemC.Endofmethod. java.lang.RuntimeException:ProblemD.Endofmethod. run.java.lang.RuntimeException:ProblemE.run. java.lang.RuntimeException:ProblemEndofmethod. ” 相关考题
考题 阅读下列程序public class VariableUse{public static void main (String[] args) {int a;if (a==8) {int b=9;System.out.println( “ a = ” +a);System.out.println( “ b = ” +b);}System.out.println( “ a = ” +a);System.out.println( “ b = ” +b);}}该程序在编译时的结果是A )变量 a 未赋值B )第二个 System.out.println( “ b = ” +b) 语句中,变量 b 作用域有错C )第二个 System.out.println( “ a = ” +a) 语句中,变量 a 作用域有错D )第一个 System.out.println( “ b = ” +b) 语句中,变量 b 作用域有错

考题 try{if((newObject))(.equals((newObject()))){System.out.println(equal”);}else{System.out.println(notequal”);}}catch(Exceptione){System.out.println(exception”);}Whatistheresult?() A.equalB.notequalC.exceptionD.Compilationfails.

考题 publicvoidfoo(booleana,booleanb){if(a){System.out.println(A”);}elseif(ab){System.out.println(AB”);}else{17.if(!b){System.out.println(notB”);}else{System.out.println(ELSE”);}}}Whatiscorrect?()A.Ifaistrueandbistruethentheoutputis“AB”.B.Ifaistrueandbisfalsethentheoutputis“notB”.C.Ifaisfalseandbistruethentheoutputis“ELSE”.D.Ifaisfalseandbisfalsethentheoutputis“ELSE”.

考题 booleanbool=true;if(bool=false){System.out.println(“a”);}elseif(bool){System.out.println(“c”);}elseif(!bool){System.out.println(“c”);}else{System.out.println(“d”);}Whatistheresult?() A.aB.bC.cD.dE.Compilationfails.

考题 阅读下面程序 public class VariableUse { public static void main(String[] arqs) { int a; if(a==8) { int b=9; System.out.println("a="+a); System.out.println("b="+b); } System.out.println("a="+a); System.out.println("b="+b): } } 该程序在编译时的结果是A.变量a未赋值B.第二个System.out.println("b="+b);语句中,变量b作用域有错C.第二个System.out.println("a="+a);语句中,变量a作用域有错D.第一个System.out.println("b="+b);语句中,变量b作用域有错

考题 阅读下列程序 public class VariableUse{ public static void main(String[]args){ inta; if(a==8){ intb=9; System.out.println("a"="+a); System.out.println("b="+b); } System.out.println("a="+a); System.out.println("b="+b); } } 该程序在编译时的结果是( )。A.变量a未赋值B.第二个System.out.println("b="+b)语句中,变量b作用域有错C.第二个System.out.println("a="+a)语句中,变量a作用域有错D.第一个System.out.println("b="+b)语句中,变量b作用域有错

考题 写出以下代码段的执行结果: int num=34, max=30; if (num >= max*2 ) System.out.println("zhang"); System.out.println("huang"); System.out.println("zhu");

考题 写出以下代码段的执行结果: int num=34, max=30; if (num >= max*2 ) System.out.println("zhang”); System.out.println("huang”); System.out.println("zhu”);

考题 1、写出以下代码段的执行结果: int num=34, max=30; if (num >= max*2 ) System.out.println("zhang"); System.out.println("huang"); System.out.println("zhu");