For the below descriptions your task is to draw a UML class diagram showing the various interfaces and classes and their relationships. Next simply explain in few sentences all the concepts that you learned from this exercise about inheritance, polymorphism, and interfaces. (Please note that for this exercise, you are not writing any program, but just drawing the UML class diagram. You can either use a diagramming tool or draw them by hand and take a picture and insert into the assignment document.) a. An interface - Monster with a method menace() with return type as void b. An interface - Dangerous Monster which inherits the Monster interface and has a method called destroy() with the void return type. (Note: Just like a class can inherit from another class, an interface can inherit from another interface using the "extends" keyword. c. An interface - Lethal with a method - Kill() with the void return type. d. A class DragonZilla which implements Dangerous Monster. This class does not have any methods of it's own but provides an implementation for the methods from Dangerous Monster. The implementation of these methods simply prints meaning full statements that include the name of the class and method using System.out.println() eg. "DragonZilla can be a menace to children" e. An interface - Vampire that extends Dangerous Monster and Lethal interfaces. This method has its own method - drinkBlood() with return type as void. (Note: An interface can inherit from multiple interfaces but a class can inherit from at most one Class.) f. A class VeryBadVampire that implements Vampire interface. The methods that are inherited would simply provide an implementation that will print the name of the class and name of the method just like in step d.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
For the below descriptions your task is to draw a UML class diagram showing the various interfaces and
classes and their relationships. Next simply explain in few sentences all the concepts that you learned
from this exercise about inheritance, polymorphism, and interfaces.
(Please note that for this exercise, you are not writing any program, but just drawing the UML class
diagram. You can either use a diagramming tool or draw them by hand and take a picture and insert into
the assignment document.)
a.
An interface - Monster with a method menace() with return type as void
b.
An interface - Dangerous Monster which inherits the Monster interface and has a
method called destroy() with the void return type.
(Note: Just like a class can inherit from another class, an interface can inherit from
another interface using the "extends" keyword.
c.
An interface - Lethal with a method - Kill( ) with the void return type.
d.
A class DragonZilla which implements Dangerous Monster. This class does not have any
methods of it's own but provides an implementation for the methods from
Dangerous Monster. The implementation of these methods simply prints meaning full
statements that include the name of the class and method using System.out.println() eg.
"DragonZilla can be a menace to children"
e. An interface - Vampire that extends Dangerous Monster and Lethal interfaces. This
method has its own method - drinkBlood() with return type as void.
(Note: An interface can inherit from multiple interfaces but a class can inherit from at
most one Class.)
f. A class VeryBadVampire that implements Vampire interface. The methods that are
inherited would simply provide an implementation that will print the name of the class
and name of the method just like in step d.
Transcribed Image Text:For the below descriptions your task is to draw a UML class diagram showing the various interfaces and classes and their relationships. Next simply explain in few sentences all the concepts that you learned from this exercise about inheritance, polymorphism, and interfaces. (Please note that for this exercise, you are not writing any program, but just drawing the UML class diagram. You can either use a diagramming tool or draw them by hand and take a picture and insert into the assignment document.) a. An interface - Monster with a method menace() with return type as void b. An interface - Dangerous Monster which inherits the Monster interface and has a method called destroy() with the void return type. (Note: Just like a class can inherit from another class, an interface can inherit from another interface using the "extends" keyword. c. An interface - Lethal with a method - Kill( ) with the void return type. d. A class DragonZilla which implements Dangerous Monster. This class does not have any methods of it's own but provides an implementation for the methods from Dangerous Monster. The implementation of these methods simply prints meaning full statements that include the name of the class and method using System.out.println() eg. "DragonZilla can be a menace to children" e. An interface - Vampire that extends Dangerous Monster and Lethal interfaces. This method has its own method - drinkBlood() with return type as void. (Note: An interface can inherit from multiple interfaces but a class can inherit from at most one Class.) f. A class VeryBadVampire that implements Vampire interface. The methods that are inherited would simply provide an implementation that will print the name of the class and name of the method just like in step d.
g. A class HorrorShow with the following implementation.
public class HorrorShow
{
public static void u(Monster b)
{
b.menace();
}
public static void v(Dangerous Monster d)
{
d.menace();
d.destroy();
}
public static void w(Lethal I)
{
I.kill();
}
public static void main(String[] args)
{
}
}
Dangerous Monster barney = new DragonZilla();
u(barney);
v(barney);
Vampire vlad = new VeryBadVampire();
u(vlad);
v(vlad);
w(vlad);
Transcribed Image Text:g. A class HorrorShow with the following implementation. public class HorrorShow { public static void u(Monster b) { b.menace(); } public static void v(Dangerous Monster d) { d.menace(); d.destroy(); } public static void w(Lethal I) { I.kill(); } public static void main(String[] args) { } } Dangerous Monster barney = new DragonZilla(); u(barney); v(barney); Vampire vlad = new VeryBadVampire(); u(vlad); v(vlad); w(vlad);
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY