Global variables?

Is there a way to make variables available to every single class without having to transfer them? It makes things difficult after a while. It’s an RPG, so most if ALL methods will use at least one of the characters stats at a point in time.

Yes, you could make them static. quick google gave this link http://www.roseindia.net/java/beginners/staticvariable.shtml

I think what’s being asked is “globally visible”, in which case you make them “public”.

Making it public is a correct answer – the right answer however, is that you transfer them. If you need to transfer a bunch of related state (variables) around at a time, you put them on an object that groups them together, along with the methods that operate on those variables, and you pass the object around.

Too bad that wasn’t the right answer. :stuck_out_tongue_winking_eye:
Sprongie answered though. Thanks.

sorry, I misunderstood your question, I thought you meant without having the object.