Exams Knowledge Hub

MCQs for Competitive Exams, School & College Exams

Module: | Classes, Objects, OOPs & Inheritance

Q28: Consider the following statements regarding Abstract Classes in Java:

1. An abstract class cannot be directly instantiated using the 'new' keyword to create an object because it may contain incomplete, body-less abstract methods.
2. Even though they cannot be directly instantiated, abstract classes can successfully possess standard constructors that are invoked via 'super()' calls from their concrete subclasses.
3. If a class is explicitly declared with the 'abstract' keyword, the Java compiler strictly mandates that it must contain at least one abstract method.

Which of the above statements is/are correct?
A
Only 1 and 2
B
Only 1 and 3
C
Only 2 and 3
D
1, 2, and 3
✅ Correct Answer: A
🎯 Quick Answer:
The correct combination is 1 and 2. Statement 3 is incorrect because an abstract class can be entirely composed of fully implemented concrete methods (0 abstract methods). The 'abstract' keyword merely prevents direct instantiation.
Concept Definition: An abstract class serves as a partial blueprint.
It is designed to be a superclass that shares common concrete logic while leaving specific, specialized method implementations to its inheriting subclasses.
Structural Breakdown: Abstract classes use the 'abstract' keyword in the class signature.
They can contain a mixture of abstract methods (without bodies) and concrete methods (with bodies), alongside instance variables and constructors.
Historical/Related Context: Abstract classes are heavily used in the Template Method Design Pattern.
The abstract parent class defines the overarching skeleton of an algorithm in a concrete method, but delegates specific, customizable steps to abstract methods that the child classes must provide.
Causal Reasoning: Abstract classes require constructors (Statement 2) because they often maintain private instance variables that represent the shared state of all child classes.
When a child class is instantiated, it must call the parent's constructor via super() to ensure that shared baseline memory is properly initialized before the child's specific memory is loaded.