Skip to main content

How does the super keyword work?

Junior Java
Quick Answer super refers to the parent class. super.method() calls the parent's version of an overridden method. super.field accesses a parent field hidden by a subclass field. super() in a constructor calls the parent constructor - must be the first statement. If you don't call super() explicitly, Java automatically inserts a call to the parent's no-arg constructor.

Answer

super refers to parent class.
Used to call parent constructors or parent methods.
Helps resolve naming conflicts between superclass and subclass.
S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice