| Home Introduction Using Holon Holon Tools Contact UsingHolonJ |
Accessing program elements
It took me some time to get used to the different cases that exist, when we have both static and instance versions of both methods and variables. Accessing static variables in a static method
Accessing static variables in an instance method
Accessing instance variables in a static method
I use a class variable to store the object reference. new myClock () creates an instance of Clock and stores the reference in the field myClock. Accessing instance variables in an instance method
new myClock () creates an instance of Clock and stores the reference in the local variable myClock.
|
|
| © 2000 Wolf Wejgaard |