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

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

  Q67.What happens when this method is called with an input of “Java rules”?
  1. public String addOK(String S) {
  2. S += “ OK!”;
  3. return S;
  4. }
  Select one correct answer
  a. The method will return “OK!”;
  b. A runtime exception will be thrown.
  c. The method will return “Java rules OK!”.
  d. The method will return “Java rules”.
  Q68.What happens during execution of the following program?
  1. public class OperandOrder {
  2. public static void main(String args[]) {
  3. int i=0;
  4. int a[] = {3,6};
  5. a = i = 9;
  6. System.out.println(i + “ “ + a + “ “ + a);
  7. }
  8. }
  Select one correct answer.
  a. Raises “ArrayIndexOutOfBoundsException”.
  b. Prints “9 9 6”.
  c. Prints “9 0 6”.
  d. Prints “9 3 6”.
  Q69.Which statements about the output of the following program are true?
  1. public class Logic {
  2. public static void main(String args[]) {
  3. int i = 0;
  4. int j = 0;
  5. boolean t = true;
  6. boolean r;

  7. r = (t & 0
页: [1]
查看完整版本: 2011年JAVA认证模拟题第二阶段(23)