RE: Static on Static

Static variables are only given one place in memory, and are accessed by
referring to the class itself, not to instances of it which are objects.

Static method and variables are initialized at load time, and are then not
bothered again except for very advanced circumstances. Objects are instances
of a class, so they each have an instance of all the variables, known as
instance variables; thus, several objects can have different values for a
particular instance variable, but if you want to have a method that is
accessible without the need to instantiate an object from a class, then you
make it static.

Take care,
Sina

-----Original Message-----
From: programmingblind-bounce@xxxxxxxxxxxxx
[mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Jared Wright
Sent: Monday, March 31, 2008 4:13 AM
To: programmingblind@xxxxxxxxxxxxx
Subject: Static on Static

Hey all, My question tonight is one of a bit more general nature. But try as
I might, I'm just not grasping the real nature of class variables vs.
instance variables and how to properly utilize both. My current learning
medium is dear ol' Java, but any handy approaches you all might have picked
up for making this important distinction would be welcome. 
I've  fixed too many issues involving static context through simple trial,
error, and luck and feel it's time to stop playing with fire. Any guidance,
as always, is appreciated.

Jared
__________
View the list's information and change your settings at 
http://www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at 
http://www.freelists.org/list/programmingblind

Other related posts: