Question: Homework 6 - Classes, Inheritance, and Polymorphism in Java Homework 6-Classes, Inheritance, and Polymorphism in Java Due: Thursday, April 12 on the server at 11:59

Homework 6 - Classes, Inheritance, and Polymorphism in Java

Homework 6 - Classes, Inheritance, and Polymorphism in Java Homework 6-Classes, Inheritance,

and Polymorphism in Java Due: Thursday, April 12 on the server at

11:59 PM, in directory hw6 1 - Objective Practice OOP concepts with

the use of multiple classes and inheritance in the Java environment. 2.1

-Super class character The first class is the base class for the

Homework 6-Classes, Inheritance, and Polymorphism in Java Due: Thursday, April 12 on the server at 11:59 PM, in directory hw6 1 - Objective Practice OOP concepts with the use of multiple classes and inheritance in the Java environment. 2.1 -Super class character The first class is the base class for the rest of the classes. This class will have four protected variables: String Type, string name, char gender, int hitPoints. You will need to create a default constructor that sets all values to defaults (i.e., Strings- null, char0', int -0.), and a constructor that takes four arguments to set the objects' four variables defined above. This class will contain an override to the toString ) function that is present in every class created in Java. This overwritten function will return the type string.format (. The format function on string will behave in the same way as System.out.format does to create the table headers (please refer to the examples in the end of the instruction about this format function) This class will contain a getType function that will return what subclass type the character is, that is, mob, townsperson, or player, described in the following. 2.2 - Super/Extended class npc This class extends the character class, and has the protected variable: string zone. You will need to create a default constructor that sets all values to defaults(String null), and an constructor that takes five arguments, all the variables from the character as well

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!