Difference between public and private variable and their uses
What is the difference between public and private variables? When do I use each one?
Re: whats the difference between public and private variables?
The public/private part of the variable is called the 'Access Modifier'
public means just that. If a variable is set to public then it can be accessed from anywhere within the class and by other classes.
If it is set to private, then the opposite applies.
Here is a good tutorial:
Declaring Member Variables (The Java™ Tutorials > Learning the Java Language > Classes and Objects)