A Bit More about Constructors

Learn a bit more about constructors.

this reference variable

The this reference variable exists for every class. It refers to the class object itself. We use this when we have an argument which has the same name as a data member. this.memberName specifies that we are accessing the memberName variable of the particular class.

Let’s see it in action:

Get hands-on with 1000+ tech skills courses.