Advertisements
Advertisements
Question
Define a class with an example.
Definition
Solution
It is a blueprint or prototype of an object. It is known as the 'Object factory' because it produces the objects of similar type.
Example: If we create a class called "Fruits," it represents a category and can have characteristics and methods that apply to all varieties of fruits.
shaalaa.com
Is there an error in this question or solution?
Chapter 1.02: Elementary Concept of Objects and Classes - EXERCISES [Page 16]