1.

Differentiate between an object and a class.

Answer»

A class is a collection of objects of similar type.

For example, mango, apple and orange are members of the class fruit. Classes are user-defined data types and behave like the built-in types of a programming language.

The syntax used to create an object is not different than the syntax used to create an integer object in C. If the fruit has been defined as a class, then the statement fruit mango; will create an object mango belonging to the class fruit.



Discussion

No Comment Found