单选题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?()AthreeBotherCAnexceptionisthrownatruntime.DCompilationfailsbecauseofanerroronline12.ECompilationfailsbecauseofanerroronline13.FCompilationfailsbecauseofanerroronline15.

单选题
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.


参考解析

解析: 暂无解析

相关考题:

以下Java应用程序执行入口main方法的声明中,正确的是( )。 A.public static void main()B.public static void main(String[] args)C.public static int main(String[] args)D.public void main(String[] args)

下列程序中,实现将封装数据类型Integer和基本数据类型int之间的转换,以及Integer,int类型和String类型之间的转换。请将程序补充完整。程序运行结果如下:123456456public class ex7_1{public static void main(String[]args) {Integer intObj;int n;String s;intObj = new Integer(123);n=intObj.__________;System.out.printin(Integer.toString(n));s=new String("456");intObj=Integer._________;System.out.println(intObj.__________);n=Integer.parseInt(s);System.out.println(Integer.toString(n));}}

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.threeB.otherC.Anexceptionisthrownatruntime.D.Compilationfailsbecauseofanerroronline12.E.Compilationfailsbecauseofanerroronline13.F.Compilationfailsbecauseofanerroronline15.

下列哪个是对main( )主方法的正确表示?A.public void static main(String args[ ]){ ... }B.void public static main(String args[ ]){ ... }C.static public void main(String args[ ]){ ... }D.以上都不正确

下列( )是对main ()主方法的正确表示。A.public void static main (String args []) {…}B.void public static main (String args []) {…}C.static public void main (String args []) {…}D.以上都不正确

以下哪个是Java应用程序main方法的有效定义? A. public static void main();B. public static void main( String args );C. public static void main( String args[] );D. public static void main( Graphics g );E. public static boolean main( String a[] );

以下是JAVA中正确的入口方法是? () A、 public static void main(String[] args){}B、 public static void main(String args){}C、 public void main(String[] args){}D、 public static int main(String[] args){}

public class test {  public static void add3 (Integer i)  int val = i.intValue ( );  val += 3;  i = new Integer (val);  } public static void main (String args [ ] )  {  Integer  i = new Integer (0);  add3 (i);  system.out.printIn (i.intValue ( )  );  } What is the result?()  A、 Compilation will fail.B、 The program prints “0”.C、 The program prints “3”.D、 Compilation will succeed but an exception will be thrown at line 3.

class Beta {  public static void main(String [] args) {  Integer x = new Integer(6) * 7;  if (x != 42) {  System.out.print("42 ");  } else if (x 〈 new Integer(44-1)) {  System.out.println("less");  } else {  System.out.print("done"); } } }  结果是什么?() A、lessB、42C、doneD、编译失败

Which declarations will allow a class to be started as a standalone program?()  A、public void main(String args[])B、public void static main(String args[])C、public static main(String[] argv)D、final public static void main(String [] array)E、public static void main(String args[])

Public class test (  Public static void stringReplace (String text)  (  Text = text.replace (‘j’ , ‘i’);  )  public static void bufferReplace (StringBuffer text)  (  text = text.append (“C”)  )   public static void main (String args[]}  (  String textString = new String (“java”);  StringBuffer text BufferString = new StringBuffer (“java”);  stringReplace (textString);  BufferReplace (textBuffer);  System.out.printLn (textString + textBuffer);  )  )   What is the output?()

下列有关main()方法的签名正确的是哪些?()A、 public static void main(String[] args){}B、 public static void main(){}C、 public static void main(String args[]){}D、 public void static main(String[] args){}

下面哪些选项是正确的main方法说明?()A、 public main(String args[])B、 public static void main(String args[])C、 private static void main(String args[])D、 void main()

作为Java应用程序入口的main方法,其声明格式可以是()。A、public static void main(String[] args)B、public static int main(String[] args)C、public void main(String[] args)D、public int main(String[] args)

public static void main( String[] args ) {  Integer a = new Integer(10);  Integer b = new Integer(10);  Integer c = a;  int d = 10;  double e = 10.0;  }   Which three evaluate to true?()   A、 (a == c)B、 (d == e)C、 (b == d)D、 (a == b)E、 (b == c)F、 (d == 10.0)

声明Java独立应用程序main()方法时,正确表达是()。A、public static void main(String[]args){…}B、private static void main(String args[]){…}C、public void main(String args[]){…}D、public static void main(){…}

class Beta {   public static void main(String [] args) {   Integer x = new Integer(6) * 7;   if (x != 42) {   System.out.print("42 ");   } else if (x.equals(42)) {   System.out.print("dot = ");   } else {   System.out.print("done");   } } }   结果为:()  A、42B、doneC、dot =D、编译失败

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、threeB、otherC、Anexceptionisthrownatruntime.D、Compilationfailsbecauseofanerroronline12.E、Compilationfailsbecauseofanerroronline13.F、Compilationfailsbecauseofanerroronline15.

下面哪些main方法可用于程序执行()A、public static void main(String[]args)B、public static void main(String[]x)C、public static void main(Stringargs[])D、public void main(String[]args)

多选题public static void main( String[] args ) {  Integer a = new Integer(10);  Integer b = new Integer(10);  Integer c = a;  int d = 10;  double e = 10.0;  }   Which three evaluate to true?()A(a == c)B(d == e)C(b == d)D(a == b)E(b == c)F(d == 10.0)

多选题Which declarations will allow a class to be started as a standalone program?()Apublic void main(String args[])Bpublic void static main(String args[])Cpublic static main(String[] argv)Dfinal public static void main(String [] array)Epublic static void main(String args[])

单选题public class Test {  public static void add3 (Integer i) {  int val = i.intValue();  val += 3;  i = new Integer(val); }  public static void main(String args[]) {  Integer i = new Integer(0);  add3(i);  System.out.println(i.intValue());  }  }   What is the result? ()A 0B 3C Compilation fails.D An exception is thrown at runtime.

单选题class Beta {  public static void main(String [] args) {  Integer x = new Integer(6) * 7;  if (x != 42) {  System.out.print("42 ");  } else if (x 〈 new Integer(44-1)) {  System.out.println("less");  } else {  System.out.print("done"); } } }  结果是什么?()AlessB42CdoneD编译失败

单选题以下是JAVA中正确的入口方法是? ()A public static void main(String[] args){}B public static void main(String args){}C public void main(String[] args){}D public static int main(String[] args){}

填空题Public class test (    Public static void stringReplace (String text) (    Text = text.replace („j„ , „i„);    )      public static void bufferReplace (StringBuffer text) (    text = text.append (“C”)   )      public static void main (String args ){  String textString = new String (“java”);    StringBuffer text BufferString = new StringBuffer (“java”);      stringReplace (textString);    BufferReplace (textBuffer);      System.out.printIn (textString + textBuffer);    }   )   What is the output?()

单选题public class test {   public static void add3 (Integer i){  int val = i.intValue ( );   val += 3;   i = new Integer (val);    }     public static void main (String args [ ] )  { Integer i = new Integer (0);    add3 (i);   system.out.printIn (i.intValue ( ) );   }    }   What is the result?()A Compilation will fail.B The program prints “0”.C The program prints “3”.D Compilation will succeed but an exception will be thrown at line 3.

单选题下面哪些选项是正确的main方法说明?()A public main(String args[])B public static void main(String args[])C private static void main(String args[])D void main()