Classes in OOPs

Classes in OOPs by Gaurav Dixit

Classes

Look at the world around you. It is full of objects of various shapes, colors, and behaviors. Based on these characterstics, these objects can be classified into different groups. These groups are called classes.
Classes act as the blueprint to create objects. An objects belonging to a given class is called the instance of the class.
A class includes attributes and methods that act on those attributes.
For Example::
A class of Students have same attributes such as name, ID and age. They have same type of behaviors, such as attending classes, taking exam, and obtaing marks.

Therefore, they can be grouped together to form a class, Student, where each Student is distinct object of this class. The following figure show the Student class and it's objects.

classes and object diagram by gaurav dixit

Post a Comment

Previous Post Next Post