Explain the use of ‘this’ keyword in Java?



Explain the use of ‘this’ keyword in Java?..

Answer / 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

More Dot Net General Interview Questions

Without UDDI, is it possible to access a remote web service ?

1 Answers   RR, TCS, Tech Mahindra,


State the methods used during deserialization and serialization process.

2 Answers  


Is it true that objects don't always get destroyed immediately when the last reference goes away?

0 Answers  


What is Global Assembly Cache (GAC) and what is the Purpose of it?

1 Answers  


What is the difference between "using system.data;" and directly adding the reference from "add references dialog box"?

0 Answers  






What is Event - Delegate? clear syntax for writing a event delegate

0 Answers  


What is the root class in .net?

0 Answers  


what is machine key error in .NET how can we solve it?

0 Answers  


What class does icon derive from? Isn't it just a bitmap with a wrapper name around it?

0 Answers  


How do you generate a strong name?

0 Answers  


how do you retrieve the customized properties of a .NET application from XML .config file? Can you automate this process?

1 Answers  


Do you know what is garbage collector?

0 Answers  


Categories