I have created an int called Strength in a method. Looks a bit like this:
public void Stats(){
int Strength = (int) Math.ceil(Math.random()*10);
int Stamina = (int) Math.ceil(Math.random()*10);
int Speed = (int) Math.ceil(Math.random()*10);
int Charisma = (int) Math.ceil(Math.random()*10);
and a second method like this:
public static int getStrength(){
return Strength;
}
This is creating an error. Eclipse says I should create a constant called Strength, but I don't want to do that, as I would like for it to be able to change.
I basically just want to use the int Strength in other methods as well as other classes. How do I do this?
Thanks.