1 | Programs are composed of a set of modules called classes. Each class is a template |
2 | specifying a set of behaviors on |
3 | the data of the class. |
4 | Each class has class variables |
5 | (sometimes called instance vars) |
6 | to hold the data and methods (called |
7 | functions or procedures in other |
8 | languages) define the behaviors. |
9 | Each object in a program is created |
10 | as an instance of a class. Each class |
11 | instance has its own copy of the class |
12 | variables. |
13 | Classes can be used for data encapsulation, hiding the details of the data representation from the user of the class. |