2.2.4 Classes and Objects

Previous Index Next


Most object oriented programming languages make a distinction between a class and an object. A class is the definition of an object. The class defines that attributes and methods that the objects has. An object is an instance of a class.

For instance the class Account would have an account number attribute and a withdraw method. In the system two Account objects could exist one with an account number of 12345 the other with and an account number 67890. If the withdraw method is called on the Account object with an account number of 12345, then code that is executed is the code that is defined on the Account class, however the data that is manipulated is the data for the Account object with the account number 12345.


1