When creating classes, it can be a lot to build each class hand by hand, line by line. Its too much code, too messy, and there are better methods to approach the creation of many different object. Enter the Factory Design Pattern. This pattern is the solution to the creation of many objects.
By definition: ” The Factory method defines an interface for creating an object, but let’s the classes that implement the interface decide which class to instantiate. The Factory method lets a class defer instantiation to subclasses. ” ( https://www.binpress.com/factory-design-pattern/ )
What this means is that we can create an interface thats sole purpose is to define what objects are being created, like a factory! You specify to the factory what you want, and the factory will build it for you, its easy!
To get a better understanding here is a UML diagram of the factory method

And here is a link to my github project on Factory methods: https://github.com/dmurtagh14/FactoryDesignPattern
In which I follow this tutorial: https://www.youtube.com/watch?v=ub0DXaeV6hA&list=PLF206E906175C7E07&index=5