Page 1 of 1

this keyword usage

Posted: Sat May 09, 2020 8:31 am
by saregg
this can only be used within the context of an instance of a class. This
means, it is available in instance initializer blocks, constructors, instance
methods, and also within a class
is mentioned in the book. Other than instance initializer blocks, constructors, instance
methods, where can this be used inside a class

Re: this keyword usage

Posted: Sat May 09, 2020 10:01 am
by admin
class A{
int a=0;
int b = this.a; <--- here
}