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

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

Dive into the depths of Java with our quiz based on "Thinking in Java, Fourth Edition" by Bruce Eckel. Test your knowledge, solidify concepts, and prepare for certification with challenging questions and insightful feedback.

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.