Computer Science, asked by aryan4025, 10 months ago

why is class called an object factory?​

Answers

Answered by avats673
9

Answer:

A class is called an object factory because objects are created from a class. An object is an instance of a class. The following statements create two objects s1 and s2 of the class Student. ... Things are similar in the world of classes and objects.

Explanation:

follow me plsss mark as Brainlist

Answered by Shubhgyanji
9

Answer:

What we do in factories?

We manufacture a same types of things by a prototype. We design one prototype and basis of that we manufacture thousands and thousands replica of that object, similarly in Object oriented programming once we designed a class, we can create hundreds or thousands similar objects of the class per need of the program.

Explanation:

We all have played computer games, we see a same type of soldiers, aliens or other object in the game. Those all character defined once and used at many places in the game.

Similar questions