Skip to content
Sharp

Core Java · interview question

When should a class be made final in Java?

Multiple choiceMediumchapter-5-curatedpremiumcore-javacode-reading-with-related-types
Choose one answer
Answer and explanation

Correct answer

C. When it should not be subclassed.

Why

A class is made final to prevent other classes from inheriting from it. This is useful when creating immutable classes or securing the implementation against further modification.

Test yourself on Core Java

A free test with instant, explained results. No account needed.

Start free test
All Core Java questions →