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 methods.

This page is posted
on the web at:

Optional Replicator mirror
on local hard disk J:

Canadian Mind Products
Please the feedback from other visitors, or your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.

Your face IP:[]
You are visitor number