Posts

Showing posts with the label java programming

this reference in Java

Image
this reference- this keyword in java programming is used to refer the current class object. this keyword is used when we want to call methods without creating object . this reference stores in the memory when an object of the current class is instantiated. We can say "this" is a special keyword in java programming which is used to refer current class object or instance of any class. By using this keyword we can call methods of current class as well as constructor. Let us see use of this reference in java and its interesting example. this is the keyword of java. this reference holds the address of current class's object. this reference can not be used inside any static context. this reference can be used inside any non-static context. this reference refers to the current class object. this reference stores in the memory how many times object of the class is instantiated. this  reference is used to call a non-static method of the current class without using the ...