Question: Define a Class called Ninja. a. Make instance variables for name, dojoName, and killCount. b. Create a static variable for totalKills c. Create a default
Define a Class called Ninja. a. Make instance variables for name, dojoName, and killCount. b. Create a static variable for totalKills c. Create a default constructor that defaults name to "No Name yet", dojoName to "No Name yet" and killCount to 0. d. Create a constructor that has parameters that set the value for name and dojo name. This will also set killCount to 0. Create accessor methods for all the variables (name, dojoName, killCount and totalKills). e. Create a method that increments killCount and totalKills f. Create a STATIC method that compares 2 ninjas to see who has more kills. This method will print out the name of the ninja with more kills and what percentage his kill number is from the total kills
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
