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

Explain the difference between managed and unmanaged code?

470


What are the new 2.0 features useful for?

647


What is typical about a windows process in regards to memory allocation in .net?

562


Explain what inheritance is, and why it's important?

513


What is web.config in .net?

597






What is a variable of implicit type and what is its scope?

522


Explain what is an interface and what is an abstract class? Please, expand by examples of using both. Explain why?

546


Define satelite assembly?

577


What does jit do?

585


object is physical and class is logical..here class is not occupying any memory as our definition of class but i got a question then the class where it stores if it is not occupying any memory....

1613


What are Attributes in .NET?

590


Explain when should you use .net web forms over asp.net mvc?

526


Write the .net syntax for 'for loop'?

579


How anonymous method is different from a lambda expression?

547


Explain the difference between static page and dynamic page?

561