1Z0-829 Utilizing Java Object-Oriented Approach Practice Question
A developer needs to ensure that a class `Shape` cannot be instantiated but can be extended. Which modifier should be used?
⚠ Common exam trap
Many candidates confuse `abstract` with `final` or `sealed`, mistakenly thinking that preventing instantiation requires a modifier that blocks extension, when in fact `abstract` is the only modifier that both prevents instantiation and allows extension.
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
✓
abstract
The `abstract` modifier is correct because an abstract class cannot be instantiated directly, but it can be extended by subclasses. This enforces the design intent that `Shape` serves as a base class for specific shapes like `Circle` or `Rectangle`, while preventing the creation of a generic `Shape` object.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
private
Why it's wrong here
A class cannot be private, only inner classes can. But even with private constructor, the class can still be instantiated via static methods, and it cannot be extended.
- ✗
final
Why it's wrong here
Final prevents extension, not instantiation.
- ✓
abstract
Why this is correct
Abstract classes cannot be instantiated and are meant to be extended.
- ✗
sealed
Why it's wrong here
Sealed classes can be instantiated directly unless declared abstract.
Go deeper
Related to this question
About these practice questions
This 1Z0-829 question is part of Courseiva's 513-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 →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This 1Z0-829 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-829 exam.