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

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

Want to excel in Java? Test your knowledge with our ultimate quiz based on 'Thinking in Java'. Engage with multiple-choice questions and in-depth explanations. Boost your understanding and prepare for your exam with confidence.

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 must a class do if it inherits from an abstract class and wants to be non-abstract?

  1. Override all methods

  2. Provide method definitions for all the abstract methods

  3. Declare itself as abstract

  4. Implement at least one method

The correct answer is: Provide method definitions for all the abstract methods

When a class inherits from an abstract class, it will inherit all of the abstract methods from the parent class. In order to be non-abstract, the class must provide definitions for all of these inherited abstract methods. This is why the correct answer is B. Option A, overriding all methods, would still make the class an abstract class because it is not providing the necessary implementations for the abstract methods inherited from the parent class. Option C, declaring itself as abstract, would also keep the class as abstract and not achieve the desired goal of being non-abstract. Option D, implementing at least one method, would also not make the class non-abstract because it is not providing definitions for all of the inherited abstract methods. Therefore, the correct answer is B.