static vs instance : Java Glossary
- static vs instance
You can make your variables or methods either static or
instance. If a variable is static, there is only one copy for the entire class, shared by all
objects of that class. If a variable is instance (i.e not static) then there is one copy per object of that class. Unlike
variables, code is never duplicated, whether the methods are instance or static. It is always shared by all objects of that class.
static methods only have access to static variables and methods of the class. Instance methods have
access to both static and instance variables and