Courseiva
Question 276 of 481
Object-Oriented ProgrammingeasyMultiple ChoiceObjective-mapped

1Z0-811 Object-Oriented Programming Practice Question

A developer wants to ensure that a class cannot be subclassed. Which keyword should be used?

⚠ Common exam trap

Oracle often tests the `final` keyword in the context of inheritance, and the trap here is that candidates confuse `final` with `abstract` (which forces subclassing) or `private` (which is about access, not inheritance prevention), leading them to pick the wrong option.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

final

The `final` keyword prevents a class from being subclassed. When a class is declared `final`, the compiler enforces that no other class can extend it, ensuring its implementation cannot be overridden or inherited. This is the correct mechanism in Java to prevent subclassing.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • final

    Why this is correct

    A class declared as final cannot be subclassed.

  • protected

    Why it's wrong here

    Protected access allows subclass access, but does not prevent subclassing.

  • private

    Why it's wrong here

    The private access modifier controls visibility within a class, not inheritance.

  • abstract

    Why it's wrong here

    An abstract class is intended to be subclassed; it cannot be instantiated directly.

  • static

    Why it's wrong here

    The static keyword is used for class-level variables and methods, not to prevent inheritance.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

1 more way this is tested on 1Z0-811

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A security-sensitive class should not be extended by any other class. Which modifier should be applied to the class declaration?

easy
  • A.final
  • B.abstract
  • C.static
  • D.private

Why A: The final modifier prevents a class from being subclassed, which is appropriate for security or design reasons.

Last reviewed: Jun 30, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This 1Z0-811 practice question is part of Courseiva's free Oracle certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 1Z0-811 exam.