Explain the use of ‘this’ keyword in Java?

Answer Posted / hrindows@gmail.com

In Java, ‘this’ keyword represents a specific reference on the current object. There are multiple uses for this keyword for referring to the current class properties from a variable, constructors, methods, and more. You can also pass this as an argument within constructors or methods. You can also fetch this as a return value from the current class instance. You can also refer to this as a static context.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between an abstract class and an interface?

703


What are the two main parts of the .net framework?

761


What is the difference between .net 2000 and .net 2005(features)? Which one is better?

721


What are the different.net tools which you used in projects?

725


what is the keyword used for self reference?

2120


What is static constructor, when it will be fired?

715


How does linq work?

765


Why inheritance is important?

755


How many types of transactions are there in com + .net ?

763


Explain about .NET services?

795


What are the collections you've used?

765


How to convert a .NET object into COM operabililty?

726


What are the types of assemblies in .net?

760


Explain me what are the deferred execution and the immediate execution in linq?

745


I'm having some trouble with cas. How can I troubleshoot the problem?

755