beginnerOOP & Core Syntax
What is the difference between this and super keywords in Java?
this refers to the current object instance — used to disambiguate a field from a same-named constructor parameter, or to call another constructor in the same class (this(...)). super refers to the immediate parent class — used to call the parent's constructor (super(...)) or to access a parent's overridden method/field explicitly.
Ready to master this question?
Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.
Sign in to generate a response