A.Compilationfails.
B.Thecoderunswithoutexception.
C.Anexceptionisthrownatline7.
D.Anexceptionisthrownatline2.
第1题:
A.Compilationfails.
B.Thecoderunswithnooutput.
C.Anexceptionisthrownatruntime.
D.Thecoderuns,outputingaconcatenatedlistoftheargumentspassedtotheprogram.
第2题:
下列程序段运行的结果为 public class Test{ static void print(String s,int i){ System.out.println("String:"+s+",int:"+i); } static void print(int i, String s){ System.out.println("int:"+i+",String:"+s); } public static void main(String [] args){ print(99,"Int first"); } }
A.String:Stringfirst,int:11
B.int:11,String:Int first
C.String:String first,int:99
D.int:99,String:int first
第3题:
main()方法的正确定义方式是()。
A.public static void main (String [ ] args ) { new NameSurfer().start (args ) ; }
B.public static main (String [ ] args ) { new NameSurfer().start (args ) ; }
C.public void main (String [ ] args ) { new NameSurfer().start (args ) ; }
D.public static void main (String [ ] args ) { NameSurfer().start (args ) ; }
第4题:
A.newInner();//Atline3
B.newInner();//Atline8
C.newo.Inner();//Atline8
D.newOuter.Inner();//Atline8
第5题:
以下哪个main方法是正确的?
A.public static void main(string[] args)
B.public static void Main(String[] args)
C.public static void main(String[] args)
D.public static main(String[] args)
E.public void main(String[] args)