Bird
0
0

What does the super keyword do in Java?

easy📝 Conceptual Q11 of 15
Java - Inheritance
What does the super keyword do in Java?
AIt defines a static method in the class.
BIt creates a new object of the child class.
CIt accesses methods and variables from the parent class.
DIt terminates the program execution.
Step-by-Step Solution
Solution:
  1. Step 1: Understand the role of super

    The super keyword is used to refer to the parent class's members (methods or variables) from a child class.
  2. Step 2: Compare options with definition

    Only It accesses methods and variables from the parent class. correctly describes this behavior. Other options describe unrelated actions.
  3. Final Answer:

    It accesses methods and variables from the parent class. -> Option C
  4. Quick Check:

    super accesses parent members = A [OK]
Quick Trick: Remember: super means parent class access [OK]
Common Mistakes:
  • Thinking super creates new objects
  • Confusing super with this keyword
  • Assuming super ends program

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Java Quizzes