Friday, May 11, 2012

What is a class?

A class is a blueprint or a model on which individual objects or instances can be created. A class will contain variables, methods that describe its behaviours. A class usually represents a blueprint of a real-life object that needs to be represented.

Example: The car Honda can be an instance of a Car class. It will have its own set of properties includign the color, model, design, number of doors etc. The instance, Honda, will have different properties than another instance of the car class, Ferrari for example.

12/5/12 Edit:

A class is a blueprint that contains attributes and functions that will be used to create instances as a representation of something.

No comments:

Post a Comment