现有: public class Tester { public static void main (String[] args) { intx-5; Integer xl=x; Integer x2=x; int x3=new Integer(5); system..ut.print(x1.equals(x)); system..ut.print(xl==x); system..ut.print(x2.equals(xl)); system..ut.print(x2==xl); system..ut.print(x2==x3); system..ut.print(x2.equals(x3)); } } 结果为:()
第1题:
A. 3
B. 4
C.5
D.6
E.7
第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题:
程序: 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("x
第4题:
class ThreadExcept implements Runnable { public void run() { throw new RuntimeException("exception "); } public static void main(String [] args) { new Thread(new ThreadExcept()).start(); try { int x = Integer.parseInt(args[0]); Thread.sleep(x); System.out.print("main "); } catch (Exception e) { } } } 和命令行: java ThreadExcept 1000 哪一个是结果?()
第5题:
现有: class Top { static int x=l; public Top (inty) { x*=3; } } class Middle extends Top { public Middle() {x+=1; ) public static void main (String [] args) { Middle m = new Middle(); System. out .println (x); } } 结果为:()
第6题:
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?()
第7题:
现有: class ThreadExcept implements Runnable { public void run() { throw new RuntimeException("exception "); } public static void main(String [] args) { new Thread(new ThreadExcept()).start(); try { int x = Integer.parseInt(args[0]); Thread.sleep(x); System.out.print("main "); } catch (Exception e) { } } } 和命令行: java ThreadExcept 1000 哪一个是结果?()
第8题:
编译失败
falsefalsetruetruetruetrue
truetruetruetruetruetrue
falsefalsetruetruetruefalse
truefalsetruefalsefalsetrue
运行时异常被抛出
第9题:
done
编译失败
运行的时候有异常抛出
less
42
第10题:
x>5
x>l
x<10
x<29
第11题:
less
42
done
编译失败
第12题:
42
done
dot =
编译失败
第13题:
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? ()
第14题:
现有: class Top { static int X=l; public Top() { x*=3; } } class Middle extends Top { public Middle() {x+=l; } public static void main(String [] args) { Middle m=new Middle(); System.out.println (x); } } 结果是什么?()
第15题:
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?()
第16题:
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"); } } } 结果为:()
第17题:
class Beta{ public static void main(String[] args){ Integer x=new Integer(6)*7; if(x!=42){ System.out.print(“42”); } else if(x
第18题:
程序: 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("x
第19题:
现有: class Number{ public static void main(String [] aras) { try { System.out.print (Integer.parselnt ("forty")); } catch (RuntimeException r) { System.out.print ("runtime"); } catch (NumberFormatException e) { system..ut.print("number"); } } } 结果是什么?()
第20题:
(a == c)
(d == e)
(b == d)
(a == b)
(b == c)
(d == 10.0)
第21题:
x>5
x>l
x<10
x<29
第22题:
Compilation will fail.
The program prints “0”.
The program prints “3”.
Compilation will succeed but an exception will be thrown at line 3.
第23题:
main
编译失败
代码运行,但没有输出
main java.lang.RuntimeException: exception