Oje me again... :$
Hello everyone...
I have a superclass Human and a subclass Warrior.
Problem is, human got this method:
public void Reveal() {
System.out.println("I am " + name + ". ");
System.out.println("My Strength is " + strength + " my Health is " + health);
System.out.println("My Intelligence is " + intelligence + " and my Agility is " + agility);
}
My warrior inherits this method but i got changes in this method. So i placed this code in my warrior class:
public void Reveal() {
System.out.println("I am " + name + " the Destroyer ");
System.out.println("My Strength is " + (strength +20) + " my Health is " + (health +50));
System.out.println("My Intelligence is " + (intelligence - 30) + " and my Agility is " + (agility - 20));
}
The thing is, i inputed all these atributes and now the warrior should show me an output where strength is +20 higher then the number inputet. Ex.: input 50 output 70
But it doesn´t... i gives me only the output from the superclass method.
It shouldn´t be like that.
The class with the main looks like this:
public class TestHuman {
public static void main(String[] arguements) {
Human Hobject = new Human();
Hobject.MyChar();
Hobject.Reveal();
}
}
Thank you for looking over it.