Dangerousmonster which inherits the monster

Assignment Help JAVA Programming
Reference no: EM13163668

For the below descriptions your task is to draw a UML class diagram showing the various interfaces and classes

  1. An interface - Monster with a method menace() with return type as void

  2. An interface - DangerousMonster which inherits the Monster interface and has a method called destroy() with void return type.
    (Note: Just like a class can inherit from another class, an interface can inherit from another interface using the "extends" keyword.

  3. An interface - Lethal with a method - Kill( ) with void return type.

  4. A class DragonZilla which implements DangerousMonster. This class does not have any methods of it's own but provides implementation for the methods from DangerousMonster. The implementation of these methods simply prints meaning full statements that includes the name of the class and method using System.out.println() eg. "DragonZilla can be menace to children"

  5. An interface - Vampire that extends DangerousMonster and Lethal interfaces. This method has it's 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.)

  6. 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.

  7. A class HorrorShow with the following implementation.

public class HorrorShow

{

public static void u(Monster b)

{

b.menace();

}

public static void v(DangerousMonster d)

{

d.menace();

d.destroy();

}

public static void w(Lethal l)

{

l.kill();

}

public static void main(String[] args)

{

DangerousMonster barney = new DragonZilla();

u(barney);

v(barney);

Vampire vlad = new VeryBadVampire();

u(vlad);

v(vlad);

w(vlad);

                        }

}

Reference no: EM13163668

Questions Cloud

The sport of gymnastics requires both impressive : The sport of gymnastics requires both impressive physical strength and extensive training for balance. The iron cross is an exercise performed on two suspended rings
Write an isr and startup code for a system that lights up le : Write an ISR and startup code for a system that lights up LED0 on the PSoC Eval1 board (assuming that a wire is connecting P1[0]) to indicate "Low Voltage"
Automated emails from google apps spreadsheet ? : How to send automated emails from google apps spreadsheet ?
Investigate the weaknesses that arise in elgamal encryption : investigate the weaknesses that arise in Elgamal encryption if a public key of small order is used. We look at the following example. Assume Bob uses the group Z
Dangerousmonster which inherits the monster : An interface - DangerousMonster which inherits the Monster interface and has a method called destroy() with void return type.(Note: Just like a class can inherit from another class, an interface can inherit from another interface using the "extends..
Create a website that would allow users to enter and submit : Create a Website that would allow users to enter and submit survey
Create huffman codes : Write a C++ program to create Huffman codes. Program input is a file called freq.txt (make up your own file for testing) that contains data on the characters in some cleartext file in the form of each character's non-zero frequency of occurrence i..
Discuss the issues that managing and implementing : Discuss the issues that managing and implementing the technology architecture you would have and how you would overcome these challenges. Be sure to discuss at least three challenges.
Give a recursive definition of s. : Let S be the set of positive integers that can be written as a sum of one or more 4's and/or 7's. For example, 7 ? S and 18 ? S (because 18 = 4 + 7 + 7)

Reviews

Write a Review

JAVA Programming Questions & Answers

  Develop java applet that will help elementary school student

Develop a Java applet that will help an elementary school student learn multiplication. Use the Math.random method or a Random object to produce two positive one-digit integers.

  Write java program to read present basic hourly wage

Write down a java program which will input 1. Read present basic hourly wage. Read in workers fist name and socond name.

  Sequence of method in vector class

Construct a Vector class implementing a number of vector operations as methods along with a testing program to verify the class is working.

  Loops and files

Convert an algorithm using control structures into Java and write a while loop

  Modify each sorting algorithm

Modify each sorting algorithm so that it keeps track of the number of comparisons it performs and the number of exchanges (swaps) it performs during a single sorting operation. Keep track of these numbers using two long integer counters

  Java program for line item application

This exercise explains you the process of testing and enhancing Line Item application. Open LineItemApp, Validator, Product, LineItem, and ProductDB classes that are in the c:java1.6ch06LineItem directory and review this code.

  Create a circle class

create acircle class, which has one field, the radius. the class should contains two constructors: a no-argument constructor that set the radius to zero, and a constructor that takes a parameter to set the radius.

  Minimal spanning tree decreasing edge dismissal

Minimal Spanning Tree Decreasing Edge Dismissal, Reverse-delete algorithm. Develop an implementation that computes the MST

  Create simulation by java language for single-server queue

Suppose that customer inter-arrival times are exponentially distributed and service times are normally distributed. Create simulation by java language for this problem and view all parametre?

  Write specifications for method which advances date by one

Write specifications for the method which advances any given date by one day. Comprise a statement of purpose, pre- and post-conditions, and description of parameters.

  Java threads

This is an introductory assignment on Java synchronization. You will use Java Threads while learning more about concurrency and achieving atomicity using Java’s inbuilt mechanisms.

  Create an array of integers at random

create an array of integers at random with a range of 0 through 1000 in Java... any hints?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd