Other than This Keyword is there any other keywords that are used to refer to an object
Yes, there are other keywords that are used to refer to an object in Java. These keywords are:
- Super
The super keyword is used to refer to the parent class of an object. It can be used to access methods and variables that are defined in the parent class. For example, if class A extends class B, then you can use the super keyword to access methods and variables that are defined in class B.
- This
The this keyword is used to refer to the current object. It can be used to access methods and variables that are defined in the current class. For example, if you have a class called Car, then you can use the this keyword to access methods and variables that are defined in class Car.
- Class
The class keyword is used to refer to the class of an object. It can be used to get the name of the class, the methods and variables that are defined in the class, and the super class of the class. For example, if you have an object of type Car, then you can use the class keyword to get the name of the class, the methods and variables that are defined in the class, and the super class of the class.
