Mastering Java: The Ultimate Quiz for 'Thinking in Java'

Disable ads (and more) with a membership for a one time $2.99 payment

Prepare for your Java exam with our ultimate quiz based on 'Thinking in Java'. Engage with expertly crafted questions that enhance your learning process. Perfect for Java enthusiasts looking to solidify their knowledge!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


In Java, a final method can still be inherited by a subclass.

  1. List

  2. Vector

  3. Hashtable

  4. HashMap

The correct answer is: Vector

The ArrayList class was added to the Java library in Java 1.2 as an alternative to Vector, which was the only collection class available at the time. While Vector is a synchronized class, which means that it is thread-safe, it is also slower and more resource-intensive compared to ArrayList, which is unsynchronized. Therefore, the development of ArrayList allows for more efficient and streamlined operations, making it a better replacement for Vector in the container library. The other options, List, Hashtable, and HashMap, were not replaced by ArrayList as they serve different purposes and are not considered interchangeable. List is an interface and is implemented by both ArrayList and Vector, while Hashtable and HashMap are both hash-based implementations of the Map interface. Therefore, while ArrayList replaced Vector, it did not replace any of the other options listed.