Exam Prep Practice Questions

Question 1 Which of the following statements about the java.util.Vector and java.util.Hashtable classes are correct? [Check all correct answers.]
  • A. A Vector can hold object references or primitive values.

  • B. A Vector maintains object references in the order they were added.

  • C. A Hashtable requires string objects as keys.

  • D. A Hashtable maintains object references in the order they were added.

  • E. Both Vector and Hashtable use synchronized methods to avoid problems due to more than one thread trying to access the same collection.

A1: Answers B and E are correct. Answer B is correct because Vector objects maintain the order in which objects are added. Answer E is correct because this is one of the major distinctions between ...

Get Java 2™ Programmer Exam Cram™ 2 (Exam CX-310-035) now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.