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

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

Mastering Java: The Ultimate Quiz for 'Thinking in Java'. Dive deep into Java with multiple-choice questions. Challenge yourself with quiz questions designed to test and improve your understanding of the 'Thinking in Java' book. Get ready for your exam!

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.