Question: Let us continue with the example of TheRevengers. Create 3 superheroes from The Revengers and then clone those superheroes using the concept of the Prototype

Let us continue with the example of TheRevengers. Create 3 superheroes from The Revengers and then clone those superheroes using the concept of the Prototype pattern.
The 3 superheroes to be cloned are : TheMagician, Axon The Slayer and Manic The Mayhem.
The steps to achieve the solution for this problem are as follows:
1. Create the Revenger interface which declares the clone method
2. Create the 3 superhero classes which define the clone function
3. Create the superhero factory which defines the prototypes for the 3 superheroes
4. Create the Revenger Prototype factory which takes the command line input and gives the desired output as mentioned below
Sample input/output looks like:
Command line input:
java PrototypeFactory TheMagician AvonTheSlayer Manic
Sample output:
The Magician
Avon TheSlayer
This prototype with the following name: Manic, doesn't exist

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!