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.


Can enums be inherited from?

  1. Yes

  2. No

The correct answer is: No

Enums can not be inherited from because they are considered to be final or fixed data types. They are used to define a set number of possible values for a variable and are typically not meant to be extended or altered. Attempting to inherit from an enum would defeat their intended purpose and potentially cause issues with code logic. Therefore, enums cannot be inherited from, making option B the correct answer.