Courseiva
Object-Oriented ProgramminghardMultiple ChoiceObjective-mapped

1Z0-811 Object-Oriented Programming Practice Question

A banking application has a base class 'Account' with a method 'withdraw()' marked as final. A subclass 'SavingsAccount' tries to override 'withdraw()'. What is the outcome?

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

Compilation error because final methods cannot be overridden

A final method cannot be overridden in a subclass. Attempting to do so results in a compilation error.

Answer analysis

Option-by-option breakdown

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

  • Compilation error because final methods cannot be overridden

    Why this is correct

    Correct. final methods cannot be overridden; attempting to do so causes a compile-time error.

  • The override works only if SavingsAccount is in the same package

    Why it's wrong here

    Package does not affect the final modifier; final methods cannot be overridden regardless of package.

  • The override succeeds, final is ignored in subclasses

    Why it's wrong here

    The final keyword explicitly prevents overriding.

  • Runtime error when the method is called

    Why it's wrong here

    The error occurs at compile time, not runtime.

About these practice questions

This 1Z0-811 question is part of Courseiva's 481-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

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.