会计考友 发表于 2012-8-4 12:33:16

2011年JAVA认证模拟题第二阶段(16)

  Q46.What is the output of the following piece of code  1. int x = 6;
  2. double d = 7.7;
  3. System.out.println((x>d) ? 99.9 : 9);
  a. 9
  b. 9.0
  c. 99.9
  d. Nothing, an ArithmeticException is thrown at line 3.
  Q47.Which of the following are legal methods for the String class ?
  a. length()
  b. toUpper()
  c. toUppercase()
  d. equals()
  Q48.Consider the following
  1. class A extends Integer {
  2. int x = 0;
  3. }
  a. The code will compile correctly.
  b. The code will not compile because Integer class is final.
  c. The code will not compile because A class doesn't have a constructor.
  d. The code will compile but an ArithmeticException at runtime.
  46. b
  47. ad
  48. b
页: [1]
查看完整版本: 2011年JAVA认证模拟题第二阶段(16)