Question: hey I need this in java I have all the enemy classes you have to create a main class I will put an example of
hey I need this in java I have all the enemy classes you have to create a main class I will put an example of a main class how want and
i will also give all the enemy classes for and you also have to make last enemy class
The Main class should create the following objects greenOgre, redOgre, slowZombie, fastZombie, spotDog, and yourNameYourObject.
Enemy Class
Enemy: Ogre Class
Enemy: Zombie Class
Enemy: Dog Class
Enemy: GiantSpider Class
Enemy: (Your) Class
example of my main class:-


enemy class ss:-





no usages public class Main \{ no usages public static void main(String[] args) \{ I/ System. out. println("Hello world!"); Item item = new Item( name: "Item name", description: "Item description", value: 10); System. out.println(item.tostring()); Weapon weapon = new Weapon( name: "Weapon name", description: "Weapon description", value: 20, damage: 8); System. out.println(weapon. str ()); Gold gold = new Gold( amt: 24); System. out.println(gold.tostring()); Sword sword = new Sword(); System. out. println(sword.tostring()); System. out.println(sword.str()); Pillow pillow = new Pillow (; System. out.println(pillow.tostring()); System. out.println(pillow. str()); Mace mace = new Mace(); System. out. println(mace.str()); Arrow arrow = new Arrow(); System. out.println(arrow.str()); Gold goldBar = new Gold( name: "Gold Bar", description: "1KG Gold Bar", amt: 200); System. out.println(goldBar.tostring()); //Class Ogre inherits from Enemy parent class public class Ogre extends Enemy //Constructor method for the ogre class //There are no input arguments public Ogre()\{ //Calls the Super class passing in the enemy's name, health points, damage points super( name: "Ogre", hp: 30, damage: 20); \} //Closes the Ogre class code block //class Zombie inherits from Enemy parent class public class Zombie extends Enemy\{ //Constructor method for the Zombie class //There are no input arguments public Zombie()\{ // Calls the Super class passing in the enemy's name, health points, damage points super( name: "Zombie", hp: 20, damage: 15); \} //Class Dog inherits from Enemy parent class public class Dog extends Enemy\{ //Constructor method for the Dog class //There are no input arguments public Dog()\{ // Calls the Super class passing in the enemy's name, health points, damage points super( name: "Dog", hp: 20, 15; \} \}//Closes the Dog class code block //class Giantspider inherits from Enemy class public class Giantspider extends Enemy\{ //Constructor method for the class public GiantSpider()\{ //Calls the Super class passing in the enemy's name, health points, damage points super( name: "Giant Spider", hp: 10, damage: 2); //Calls the super class constructor \}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
