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

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×
Our website is made possible by ad-free subscriptions or displaying online advertisements to our visitors.
If you don't like ads you can support us by buying an ad-free subscription or please consider supporting us by disabling your ad blocker. Thank you.