DAY :31 This , Super class in JAVA.

What is this keyword in Java? In Java, this is a reference variable that refers to the current object on which the method or constructor is being invoked. Why is this keyword used? This keyword in Java refers to the 'current object' in a method or constructor. It is used to reduce the confusion between class attributes and parameters with the same name What is super class? The super keyword in Java is a reference variable that refers to the immediate parent class object. It is primarily used in inheritance scenarios to access or call members (methods, variables, and constructors) of the superclass from within a subclass. How to use super keyword in java? The super keyword in Java is used to access members of the superclass (parent class) from within a subclass.

Apr 23, 2025 - 02:25
 0
DAY :31 This , Super class in JAVA.

What is this keyword in Java?

In Java, this is a reference variable that refers to the current object on which the method or constructor is being invoked.

Why is this keyword used?

This keyword in Java refers to the 'current object' in a method or constructor. It is used to reduce the confusion between class attributes and parameters with the same name

Image description

What is super class?

The super keyword in Java is a reference variable that refers to the immediate parent class object. It is primarily used in inheritance scenarios to access or call members (methods, variables, and constructors) of the superclass from within a subclass.

How to use super keyword in java?

The super keyword in Java is used to access members of the superclass (parent class) from within a subclass.

Image description