You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
public class Wizard{ int health; String weapon; String spell; public Wizard(){ this.health = 100; this.weapon = "Staff"; this.spell = "Arcane Arrow"; } public Wizard(int health,String weapon,String spell){ this.health = health; this.weapon = weapon; this.spell = spell; } public void drinkPotion(){ this.health += 10; } public void drinkPotion(int potion){ this.health += potion; } public void wizardDetails(){ System.out.println("This Wizard has a total health of: " + this.health); System.out.println("This Wizard carries a " + this.weapon + " and can cast " + this.spell + "."); System.out.println(); } /* public static void main(String[] args){ } */ }
|