class Beta{   public static void main(String[] args){   Integer x=new Integer(6)*7;   if(x!=42){   System.out.print(“42”);   } else if(xSystem.out.println(“less”);   }else{   System.out.print(“done”);   }}}   结果是什么?()   A、doneB、编译失败C、运行的时候有异常抛出D、lessE、42

题目

class Beta{   public static void main(String[] args){   Integer x=new Integer(6)*7;   if(x!=42){   System.out.print(“42”);   } else if(xSystem.out.println(“less”);   }else{   System.out.print(“done”);   }}}   结果是什么?()  

  • A、done
  • B、编译失败
  • C、运行的时候有异常抛出
  • D、less
  • E、42
如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

classBeta{publicstaticvoidmain(String[]args){Integerx=newInteger(6)*7;if(x!=42){System.out.print("42");}elseif(x〈newInteger(44-1)){System.out.println("less");}else{System.out.print("done");}}}结果是什么?()

A.less

B.42

C.done

D.编译失败


参考答案:A

第2题:

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、less
  • B、42
  • C、done
  • D、编译失败

正确答案:A

第3题:

classBeta{publicstaticvoidmain(String[]args){Integerx=newInteger(6)*7;if(x!=42){System.out.print(42”);}elseif(xSystem.out.println(less”);}else{System.out.print(done”);}}}结果是什么?()

A.done

B.编译失败

C.运行的时候有异常抛出

D.less

E.42


参考答案:D

第4题:

现有:   class Parser extends Utils {   public static void main(String [] args) {     System.out.print(new Parser().getInt("42"));    }   int getInt(String arg) {  return Integer.parseInt(arg);  }    }   class Utils {     int getInt(String arg) throws Exception { return 42; }    }    结果为()  

  • A、 42
  • B、 编译失败。
  • C、 无输出结果。
  • D、 运行时异常被抛出。

正确答案:A

第5题:

现有  class Parser extends Utils {  public static void main (String  []  args)  {  try  {  System.out.print (new Parser () .getlnt ("42"))       }  catch (Exception e) {  System.out.println ("Exc") ;  }      }  int getlnt (String arg)  throws Exception  {     return Integer.parselnt (arg) ;      }      }  class Utils {  int getlnt ()  {  return 42;  }     }  结果是什么?()      

  • A、 42Exc
  • B、 Exc
  • C、 42
  • D、编译失败

正确答案:C

第6题:

class Flibitz{   public static void main(String[] args){   int grop=7;   new Flibitz().go(grop);   System.out.print(grop);  }   void go(int grop){   if(++grop>7) grop++;   System.out.print(grop);   }   } 结果为:()  

  • A、99
  • B、编译失败
  • C、运行时异常被抛出
  • D、77
  • E、79
  • F、97

正确答案:F

第7题:

现有:  class Parser (类)extends(继承) Utils {   public static void main(String [] args) {   System.out.print(输出打印)(new Parser().getInt("42"));  }   int getInt(String arg) {   return Integer.parseInt(arg);    }   }   class Utils {   int getInt(String arg) throws Exception { return 42; }  }   结果为:()  

  • A、 42
  • B、 编译失败。
  • C、 无输出结果。
  • D、 运行时异常被抛出。

正确答案:A

第8题:

classBeta{publicstaticvoidmain(String[]args){Integerx=newInteger(6)*7;if(x!=42){System.out.print("42");}elseif(x.equals(42)){System.out.print("dot=");}else{System.out.print("done");}}}结果为:()

A.42

B.done

C.dot=

D.编译失败


参考答案:C

第9题:

class Number {  public static void main(String [] args) {  try {  System.out.print(Integer.parseInt("forty ")); } catch (RuntimeException r) {  System.out.print("runtime ");  } catch (NumberFormatException e) {  System.out.print("number ");  }  }  }  结果是什么?() 

  • A、forty
  • B、number
  • C、runtime
  • D、编译失败

正确答案:D

第10题:

class Bird {  static void talk() { System.out.print("chirp "); }  }  class Parrot extends Bird {  static void talk() { System.out.print("hello "); }  public static void main(String [] args) {  Bird [] birds = {new Bird(), new Parrot()};  for( Bird b : birds)  b.talk();  }  }  结果为:() 

  • A、chirp chirp
  • B、chirp hello
  • C、hello hello
  • D、编译失败

正确答案:A

更多相关问题