Static Variables and Methods
Get familiar with static variables and methods in this lesson.
We'll cover the following...
We previously discussed static methods in Unit 2. Let’s take a final look at them in this section.
Important points
-
A static method is associated with the class, not the objects of the class.
-
Static methods include the
static
keyword in the header before the method name. -
Static methods cannot access or change the values of instance variables, except for the static ones. ...