Rob Prime wrote:A horribly misspelled FAQ...
sunil langeh wrote:
Benjamin Hiner wrote:
sunil langeh wrote:
Ankit Garg wrote:'this' is not a instance. It is a keyword used to refer to the current object on which any non-static method was called. So you can say that it is a reference to the current object available inside non-static methods. Abstract classes have nothing to do with it...
Hi Ankit , Is it mean that we can't use "this" within an Abstract class???
You can use this in functions defined in an abstract class. When you are actually executing the code the 'this' will be referring to whatever derived concrete class the object really is at runtime.
Hi Benjamin, I am getting confused with - As we know that in an Abstract class there is no 'new' right?...and 'this' is invoked when class is instantiated i.e when an object is created(new classxx();)
So if we do not instantiated an Abstract class then how can be use 'this' with in it??
please correct me if i am creating little mistake or just behind the actual concept
sunil langeh wrote:
Ankit Garg wrote:'this' is not a instance. It is a keyword used to refer to the current object on which any non-static method was called. So you can say that it is a reference to the current object available inside non-static methods. Abstract classes have nothing to do with it...
Hi Ankit , Is it mean that we can't use "this" within an Abstract class???