Can this keyword be used to refer static members?

Yes, It is possible to use this keyword to refer static members because this is just a reference variable which refers to the current class object. However, as we know that, it is unnecessary to access static variables through objects, therefore, it is not the best practice to use this to refer static members. Consider… Continue reading Can this keyword be used to refer static members?

What are the main uses of this keyword?

There are the following uses of this keyword. this can be used to refer to the current class instance variable. this can be used to invoke current class method (implicitly) this() can be used to invoke the current class constructor. this can be passed as an argument in the method call. this can be passed as an argument in the constructor call.… Continue reading What are the main uses of this keyword?