Level 4 — Classes
Members
Original notes by SunDiaL · View English source
Class members are variables or functions defined inside a class. They are:
Defining a member
This will be detailed in each section separately.
Using a member
From outside the class definition
With the exception of constructors (which are used to create an instance), all accessible members are accessed with a dot, through an instance.
From inside the class definition
Since there is no instance yet, accessible members are accessed with a dot, through the this keyword.
Note: Most of the time the
thiskeyword can be omitted if there's no ambiguity.