Computer Science

Why is class referred to as object factory?

Objects & Classes

4 Likes

Answer

A class has the complete description of the data elements the object will contain, the methods the object can do, the way these data elements and methods can be accessed. A class can create objects of itself with different characteristics and common behaviour just like a factory can produce similar items based on a particular design. Hence, class is also referred to as 'Object Factory'.

Answered By

2 Likes


Related Questions