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

2011年JAVA认证模拟题(29)

 Q85 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
  ++i;
  inner: do {
  ++j;
  if(i++ % 3 ==2) break inner;
  else if(j++ %3 ==1) break outer;
  System.out.println(i*j);
  } while (j < i );
  System.out.println(i+j);
  }
  }
  }
  A 5
  B 6
  C 7
  D The program does not display any output.
  Q86 What is the preferred way to handle an object’s events in Java 2?
  A Override the object’s handleEvent() method.
  B Add one or more event listeners to handle the events.
  C Have the object override its processEvent() methods.
  D Have the object override its dispatchEvent() methods.
  Q87 What is wrong with the following for statement?

  for(i=0; j=0, i
页: [1]
查看完整版本: 2011年JAVA认证模拟题(29)