Start New Discussion within our Software Development Community

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.

NEVER MIND!!!

Im so stupid... didn´t create the warrior object in my main hihi.... sorry to bother you with this...ARGH

This question has already been answered. Start a new discussion instead.