why is a class a factory of objects ????
Answers
Answered by
2
A class represents a set of objects that have a common characteristics and behaviour. It is known as an object factory becauase it has all the statement to create an object, it's attributes and functions to be performed
oreo7:
thank you
Answered by
0
Answer:
The term factory typically is used for holding similar kind of objects within it. Generally, an object is created by using information available in the class. It also contains details of an object's internal data and when an object is brought into existence, it is called instantiation.
Thus, we can conclude that class is a prototype of an object. Each object belonging to a specific class possesses the data and the methods defined within the class. It produces objects of similar type. Hence, it is termed as object factory.
Similar questions
Biology,
9 months ago
English,
9 months ago
Environmental Sciences,
9 months ago
Social Sciences,
1 year ago
Physics,
1 year ago