Getting Started with Java
This is a 100% free course, but we need you to first join or login to watch this video.
Alright, join or login here.This video introduces the ‘this’ keyword in Java after showing how variable scope and lifetime differs for local, parameter, static and instance variables. When a static variable and a local or parameter variable have the same name, the local or parameter variable hides it. When an instance variable and a local or parameter variable have the same name, the local or parameter variable hides it. The this keyword points to the current object in question. The ‘this’ keyword can refer to non-static variable or non-static method from the same class along with constructors.