vendredi 20 septembre 2019

How to initialize the classes in factory method which have constructors with multiple parameters

Lets say I have a Shape interface which calculates the area of shape. I add 2 implementations Circle and Square. The challenge I see is both implementations have their own multiple argument constructors. How do I initialize them using a factory pattern. I wanted to solve it using java.

Aucun commentaire:

Enregistrer un commentaire