Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 11 The Ultimate Database For Cloud Analytics And Mobile

Authors: John Campbell, Chris Crone, Gareth Jones, Surekha Parekh, Jay Yothers

1st Edition

1583474013, 978-1583474013

More Books

Students also viewed these Databases questions

Question

=+Target Corp. January 28 The Limited, Inc. February 2

Answered: 1 week ago

Question

2. Develop a persuasive topic and thesis

Answered: 1 week ago

Question

1. Define the goals of persuasive speaking

Answered: 1 week ago