What is the Factory and Factory pattern?
A factory creates different objects for a prototype. It is done By calling the corresponding constructor when different classes are registered with the factory.
The Factory pattern directly creates an object without calling the constructor method. It allows the use of polymorphism for object creation.