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

2011年JAVA认证模拟题(30)

java认证试题:2011年JAVA认证模拟题(30)
 Q88 What changes are needed to make the following program compile?
  import java.util.*;
  class Question {
  public static void main(String args[])
  {
  String s1 = “abc”;
  String s2 = “def”;
  Vector v = new Vector();
  v.add(s1);
  v.add(s2);
  String s3 = v.elementAt(0) +
  v.elementAt(1);
  System.out.println(s3);
  }
  }
  A Declare Question as public
  B Cast v.elementAt(0) to a String
  C Cast v.elementAt(1) to an Object
  D Import java.lang
  Q89 What is the value of a as the result of the following array declaration?
  int [] a = {1,2,3,4,5};
  A 1
  B 2
  C 3
  D 4
  Q90 What Java statement is used to completely abort the execution of a loop?
  A The continue statement.
  B The goto statement
  C The exit statement
  D The bread statement
  Q088 B
  Q089 D
  Q090 D
页: [1]
查看完整版本: 2011年JAVA认证模拟题(30)