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

Question: 1 / 510

What alternative do enums have since they cannot be inherited from?

Extending classes

Implementing interfaces

Enums in Java cannot be inherited from, so options A and C, which describe a process

of inheriting attributes from other classes, are incorrect. Option D is also incorrect

because there is another alternative for enums besides inheritance. Rather, enums have

the alternative of implementing interfaces, which allows them to define their own

methods and attributes while still preventing them from being inherited. This is why

option B is the correct answer.

Get further explanation with Examzify DeepDiveBeta

Static importing

None of the above

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy