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.


What does polymorphism allow in object-oriented programming?

  1. Objects to change their type at runtime

  2. A single interface to be used for different underlying forms of data

  3. For objects to exist in multiple states simultaneously

  4. For objects to automatically delete themselves once they are no longer needed

The correct answer is: A single interface to be used for different underlying forms of data

Polymorphism allows for a single interface to be used for different underlying forms of data. This means that although an object may have many different forms or classes, it can be used interchangeably through a common interface. Option A is incorrect because objects cannot change their type at runtime. Once an object is created, its type is fixed and cannot be changed. Option C is also incorrect because objects cannot exist in multiple states simultaneously. Objects can only have a single state at any given time. Option D is incorrect because objects do not automatically delete themselves. The programmer is responsible for managing the memory of the objects they create.