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

2011年JAVA认证模拟题(34)

  Q100 What is the value of 8|9&10^11?
  A 8
  B 9
  C 10
  D 11
  Q101 What is the output of the following program?
  class S1 {
  public static void main(String [] args)
  {
  new S2();
  }
  S1() {
  System.out.print(“S1”);
  }
  }
  class S2 extends S1 {
  S2() {
  System.out.print(“S2”);
  }
  }
  A S1
  B S2
  C S1S2
  D S2S1
  Q102 What would be the result of attempting to compile and run the following piece of code?
  public class Test {
  static int x;
  public static void main (String args[])
  {
  System.out.println(“Value is “ + x);
  }
  }
  A The output “Value is 0 ” is printed.
  B An object of type NullPointerException is thrown.
  C An “illegal array declaration syntax” compiler error occurs.
  D A “ possible reference before assignment” compiler error occurs.
  Q100 D
  Q101 C
  Q102 A
页: [1]
查看完整版本: 2011年JAVA认证模拟题(34)