Classes and Objects
- slide 15 : 29
Class Variables
A
class variable
belongs to the class, and it is shared among all instances of the class.
Class variables
are declared by use of the
static
modifier in C#
may be used as
global variables
- associated with a given class
do typically hold
meta information
about the class, such as the number of instances
The class BankAccount with a class variable.
A client of class BankAccount.
Output of the BankAccount client program.
Sharing the Random Generator