classjava{publicstaticvoidmain(String[]java){for(intJava=1;Java〈java.length;Java++)System.out.print(java);}}和命令行:javajavajavajavajava结果为:() A.javaB.javajavaC.javajavajavaD.编译失败
classjava{publicstaticvoidmain(String[]java){for(intJava=1;Java〈java.length;Java++)System.out.print("java");}}和命令行:javajavajavajavajava结果为:()
A.java
B.javajava
C.javajavajava
D.编译失败
相关考题:
( 19 )阅读下列代码public class Test2005{public static void main(String args[]){String s= ″ Test ″ ;Switch(s){case ″ Java ″ : System.out.print( ″ Java ″ ) ;break ;case ″ Language ″ : System.out.print( ″ Language ″ ) ;break ;case ″ Test ″ : System.out.print( ″ Test ″ ) ;break ;}}}其运行结果是A ) JavaB ) LanguageC ) TestD )编译出错
publicclassFoo{staticint[]a;static{a[0]=2;}publicstaticvoidmain(String[]args){}}Whichexceptionorerrorwillbethrownwhenaprogrammerattemptstorunthiscode?() A.java.lang.StackOverflowErrorB.java.lang.IllegalStateExceptionC.java.lang.ExceptionlnlnitializerErrorD.java.lang.ArraylndexOutOfBoundsException
publicclasstest{publicstaticvoidmain(String[]a){asserta.length==1;}}WhichtwowillproduceanAssertionError?() A.javatestB.java-eatestC.javatestfile1D.java-eatestfile1E.java-eatestfile1file2F.java-ea:testtestfile1
阅读下面代码 public class Test2005 { public static void main(String args[]) { String s="Test"; switch(s) { case"Java":System.out.print("Java"); break; case"Language":System.out.print("Language"): break; case"Test":System.out.print("Test"); break; } } } 其运行结果是A.JavaB.LanguageC.TestD.编译出错
阅读下列代码 public class Test { public static void main(String args[]) { String s = "Test"; switch (s) { case "Java": System.out.print("Java"); break; case "Language": System.out.print("Language"); break; case "Test": System.out.print("Test"); break; } } } 其运行结果是( )。A.JavaB.LanguageC.TestD.编译出错
阅读卜列代码 public class Test2005{ public static voidmain(Stringargs[]){ String s="Test"; switch(s){ case"Java":System.out.print("Java"); break; case"Language":System.out.print("Language"); break; case"Test":System.out.print("Test"); break; } } } 其运行结果是( )。A.JavaB.LanguageC.TestD.编译时出错
阅读下列代码 public class Test2005 { public static void main(String args[]){ String s="Test"; switch (s){ case "Java": System.out.print("Java"); break; case "Language": System.out.print("Language"); break; case "Test": System.out.print("Test"); break; } } } 其运行结果是( )。A.JavaB.LanguageC.TestD.编译出错
阅读下列代码 public class Test2005{ public static void main(String args[]){ String s="Test"; switch(s){ case"Java":System.out.print("Java"); break; case"Language":System.out.print("Lan- guage"); break; case"Test":System.out.print("Test"); break; } } } 其运行结果是( )。A.JavaB.LanguageC.TestD.编译时出错
给定以下JAVA代码,这段代码编译运行后输出的结果是( )publicclassTest{publicstaticintaMethod(inti)throwsException{try{returni/10;}catch(Exceptionex){thrownewException("exceptioninaaMothod");}finally{System.out.print("finally");}}publicstaticvoidmain(String[]args){try{aMethod(0);}catch(Exceptionex){System.out.print("exceptioninmain");}System.out.print("finished");}}A、finallyexceptioninmainfinishedB、exceptioninmainfinallyC、finallyfinishedD、finallyexceptioninmainfinished