Question: Create an interface called Mammal. Create the concrete classes ( i . e . , Human, Dog, and Cat ) implementing the Mammal interface. Create
Create an interface called Mammal. Create the concrete classes ie Human, Dog, and Cat implementing the Mammal interface. Create the factory MammalFactory to generate the objects of the Human, Dog, and Cat classes. Create a demo class FactoryPatternDemo to use the MammalFactory to get the objects of the concrete class.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
