Welcome to the Treehouse Community
Looking to learn something new?
Class Instances and Methods
My biggest question about this is how I can keep an instance of a class consistent with many methods and more to them. Like if I make a player instance of a class and call it Tim in the main method, how would I be able to use that same Tim instance in a different method?
Steven Parker215,958 Points
If you create an instance of another class in a variable of your current class, any method of the current class would have access to it. Just be sure to use a class variable and not a local variable of the method that creates it.
OH OK, I get it now. I see what you mean. That helps a lot. Thanks! You were of great help.