更多"11.public static void main(String[]"的相关试题:
[单项选择] public static void main(String[]args){ String str="null"; if(str==null){ System.out.println("null"); }else(str.length()==0){ System.out.println("zero"); }else{ System.out.println("some"); } } What is the result?()
A. null
B. zero
C. some
D. Compilationfails.
E. Anexceptionisthrownatruntime.
[单项选择] public static void main(String[]args){ Integer i=new Integer(1)+new Integer(2); switch(i){ case3:System.out.println("three");break; default:System.out.println("other");break; } } Whatistheresult?()
A. three
B. other
C. Anexceptionisthrownatruntime.
D. Compilationfailsbecauseofanerroronline12.
E. Compilationfailsbecauseofanerroronline13.
F. Compilationfailsbecauseofanerroronline15.
[判断题]main( ) 方法的定义是public static void main(String args[])。
[单项选择] public static void main(String[]args){ for(inti=0;i<=10;i++){ if(i>6)break; } System.out.println(i); } What is the result?()
A. 6
B. 7
C. 10
D. 11
E. Compilation fails.
F. Anexception is thrown at runtime.
[单项选择]以下的C#代码:static void Main(string[]args){Console.WriteLine("运行结果:{0}",Console.ReadLine());Console.ReadLine();}代码运行结果为()。
A. 在控制台窗口显示“运行结果:”
B. 在控制台窗口显示“运行结果:{0}”
C. 在控制台窗口显示“运行结果:,Console.ReadLine”
D. 如果用户在控制台输入“A”,那么程序将在控制台显示“运行结果:A”
[单项选择] public classYippee{ public static void main(String[]args){ for(intx=1;xSystem.out.print(args[x]+""); } } } and two separate command line invocations:j avaYippee javaYippee1234 What is the result?()
A. No output is produced. 123
B. No output is produced. 234
C. No output is produced. 1234
D. An exception is thrown at runtime. 123
E. An exception is thrown at runtime. 234
F. An exception is thrown at runtime. 1234
[单项选择] public class Pass{ public static void main(String[]args){ int x=5; Pass p=new Pass(); p.doStuff(x); System.out.print("mainx="+x); } void doStuff(intx){ System.out.print("doStuffx="+x++); } } What is the result?()
A. Compilation fails.
B. An exception is thrown at runtime.
C. doStuff x=6 main x=6
D. doStuff x=5 main x=5
E. doStuff x=5 main x=6
F. doStuff x=6 main x=5
[单项选择] public class Test{ public static void main(String[]args){ intx=5; boolean b1=true; boolean b2=false; if((x==4)&&!b2) System.out.print("l"); System.out.print("2"); if((b2=true)&&b1) System.out.print("3"); } } What is the result?()
A. 2
B. 3
C. 12
D. 23
E. 123
F. Compilation fails.
G. An exceptional ist hrown at runtime.
[单项选择] 程序: class TestApp{ public static void main (String[] args){ int x=6; if (x>l) System. out. println("x>l"); else if (x>5) System. out .println("x>5"); else if (x<10) System. out. println("xA. x>5
B. x>l
C. x<10
D. x<29
[单项选择] 现有: class TestApp{ public static void main (String[] args){ for (int i=0; iA. 0123
B. 012456789
C. 0123456789
D. 012
[单项选择]现有:class Test2 fpublic static void main (String [] args) {short a,b,C;a=1;b=2;C=a+b;a+=2;}}以上代码中,哪一句是错误的?()
A. a=1;
B. C=a+b;
C. a+=2;
D. shorta,b,C;
[单项选择]
阅读下面程序
pubic class Cycle{
public static void main(String args[]){
System. out. println(args[0]);
在命令行中输入java Cycle one two,该程序输出结果是()
A. Cycle
B. one
C. two
D. 上述A、B、C、均不对
[单项选择]
阅读下列代码
public class Test{
public static void main(String args[]){
System. out. println((2<0) 10:8);
}
}
其运行结果是()
A. 2
B. 0
C. 10
D. 8
[单项选择] 现有: 1. class Wrench f 2.public static void main(String [] args) { 3.Wrench w=new Wrench( ); Wrench w2=new Wrench( ); 4. w2=go (w, w2); 5.System.out.print (w2==w); 6. } 7.static Wrench go (Wrench wrl, Wrench wr2) { 8.Wrench wr3=wrl; wrl=wr2; wr2=wr3; 9. return wr3; 10. } 11. } 结果是什么?()
A. false
B. true
C. 编译失败
D. 运行的时候有异常抛出
[单项选择] public static void main(String[] args) { String str = “null‟; if (str == null) { System.out.println(”null”); } else (str.length() == 0) { System.out.println(”zero”); } else { System.out.println(”some”); } } What is the result?()
A. null
B. zero
C. some
D. Compilation fails.
E. An exception is thrown at runtime.