class Beta{ public static void main(String[] args){ Integer x=new Integer(6)*7; if(x!=42){ System.out.print(“42”); } else if(x
第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.编译失败
第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"); } } } 结果是什么?()
第3题:
A.done
B.编译失败
C.运行的时候有异常抛出
D.less
E.42
第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; } } 结果为()
第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; } } 结果是什么?()
第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); } } 结果为:()
第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; } } 结果为:()
第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.编译失败
第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 "); } } } 结果是什么?()
第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(); } } 结果为:()