| ||Classes and Objects - slide 12 : 29|
Overview of members in classes
The most important members of a class are variables and methods.
- Instance variable
- Defines state that is related to each individual object
- Class variable
- Defines state that is shared between all objects
- Instance method
- Activated on an object. Can access both instance and class variables
- Class method
- Accessed via the class. Can only access class variables
Class variables and class methods are marked with the modifier static.
No modifier is used for instance variables and instance methods.