Bird
0
0

Which of the following is the correct way to call a parent class constructor in Java?

easy📝 Syntax Q12 of 15
Java - Inheritance
Which of the following is the correct way to call a parent class constructor in Java?
Asuper();
Bthis();
Cparent();
Dbase();
Step-by-Step Solution
Solution:
  1. Step 1: Recall syntax for parent constructor call

    In Java, super() is used inside a child constructor to call the parent class constructor.
  2. Step 2: Evaluate options

    Only super(); uses the correct keyword super(). Others are invalid or refer to different concepts.
  3. Final Answer:

    super(); -> Option A
  4. Quick Check:

    Parent constructor call = super() [OK]
Quick Trick: Use super() to call parent constructor [OK]
Common Mistakes:
  • Using this() instead of super()
  • Trying to call parent() which is invalid
  • Confusing base() with super()

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Java Quizzes