Java has three types of variables -
instance variables,
class variables,
and
local variables.
Instance variables are used to define the attributes for a particular
object.
Local variables are used for temporary information used inside a
method and only exist while the method is being executed.
Class variables are used to store information that apply to all instances
of a class.
Java does not have global variables (values that can be referenced
everywhere).
To use a variable, you first must declare it:
type variableName;
type variable1, variable2, variable3;
The type can be a class or a primitive (like int).
You may initialize a variable at the same time it is declared by assigning it a value with the equal sign.
Note that this statement is still a declaration, even though it is assigning a value.
Variable names in Java may begin with a letter, underscore, or dollar sign
and can be made up of any characters, including Unicode, after that.
Java naming conventions use camel-back: variable (and method) names start with a lower-case letter,
and each word in the identifier is capitalized. For instance: smallestInt or onePermission.