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

2011年JAVA认证模拟题(57)

  Q169 Which of the following methods are methods of the String class?
  A delete()
  B append()
  C reverse()
  D replace()
  Q170 What line of output is displayed by the following program?
  class Question {
  static boolean sideEffect (boolean b) {
  System.out.print(“ side effect “);
  return b;
  }
  public static void main (String[] args)
  {
  boolean b1 = true;
  boolean b2 = false;
  if(b2 & sideEffect(b1))
  System.out.println(1);
  else if (b1 | sideEffect(b2))

  System.out.println(2);

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

2011年JAVA认证模拟题(57)

</p>  }
  }
  A 1
  B 2
  C side effect 1
  D side effect 2
  E side effect side effect 1
  F side effect side effect 2
  Q171 If you ran the following program, which lines would be included in its output?
  class Question {
  public static void main (String[] args)
  {
  int i = 1;
  int j = 2;
  outer: while (i < j) {
  ++i;
  inner: do {
  ++j;
  if(j % 3 == 0) continue outer;
  if(i % 3 == 0) break inner;
  if(i % 3 == 1) break outer;

  System.out.println(i * j);

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

2011年JAVA认证模拟题(57)

</p>  } while (j < i);
  System.out.println(i + j);
  }
  }
  }
  A 5
  B 6
  C 7
  D The program does not display any output.
  Q172 Which of the following java.util classes support internationalization?
  A Locale
  B ResourceBundle
  C Country
  D Language
  Q169 D
  Q170 F
  Q171 C
  Q172 AB
页: [1]
查看完整版本: 2011年JAVA认证模拟题(57)