English

State any one purpose of using the keyword this in Java programming. - Computer Science (Theory)

Advertisements
Advertisements

Question

State any one purpose of using the keyword this in Java programming.

Answer in Brief
Advertisements

Solution

  1. In an instance method or constructor, this is a reference to the current object.
  2. The most common reason for utilising this term is when a field is shadowed by a method or constructor argument.
shaalaa.com
Object as an Instance of a Class
  Is there an error in this question or solution?
2022-2023 (March) Official
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×