What is a Class?

An class is a software bundle of related variables and methods.

A class is a blueprint or prototype that defines the variables and the methods common to all objects of a certain kind.

state = variables

behaviors = methods

Such encoding of information provides:

Modularity: The source code for an object can be written and maintained independently of the source code for other objects. Also, an object can be easily passed around in the system. You can give your bicycle to someone else, and it will still work.

Information hiding: An object has a public interface that other objects can use to communicate with it. The object can maintain private information and methods that can be changed at any time without affecting the other objects that depend on it. You don't need to understand the gear mechanism on your bike to use it.

You can create as many objects as you wish

 

......remember an Object is an instantiation of a Class

© Lynne Grewe