Computer Applications
Answer
A class is a blueprint of a set of objects that have a common structure and behaviour. Once a class is defined, any number of objects can be created. All the objects have common attributes and behaviour. Thus, classes are said to be abstractions of or a set of objects. We can think of a class as a cookie cutter and an object as an actual cookie.
Related Questions
How are classes and objects related to one another?
Can there be multiple classes for the complete representation of a real world entity ? Give examples.
Why are objects said to be instances of a class ?
Consider the following code fragment assuming that a class namely Student has been defined earlier :
Student stud1;What is above statement doing ?