Computer Science, asked by kajalkk, 8 months ago

Why is class called a factory of a object

Answers

Answered by srabani80pal
2

A class is called an object factory because objects are created from a class. An object is an instance of a class. ... In class-based programming, objects are created from classes by subroutines called constructors, and destroyed by destructors.

Answered by Rudha24
1

Answer:

Because with a class you can create many objects without writing much code. Like in a factory, objects can be mass-produced.

Similar questions