I\'m in my first programming class in high school. We\'re doing our end of the first semester project. This project only involves one class, but many methods. My question is
Short story: if and only if a variable needs to be accessed by more than one method(or outside of the class) create it as an instance variables. If you need it only locally, in a single method, it has to be a local variable. Instance variables are more costly than local variables.
Keep in mind: instance variables are initialized to default values while local variables are not.