hi there, its been a long time n have a question again.i want to know about the memory difference betwen a static n a non-static variable.how much memory they alocate n exactly wat difference is made when a static or a non static vriable is used.i mean what is the criteria for using a static or a non static variables.i hope that u ppl will reply me asap. take care with regards kumar abhay
If you have a variable that should be shared by all instances of a class, then declare it static, since only one static variable exists for the entire class and sunclasses. Since only one static variable exists it takes less memory than instance variables which exixt for each instance of the class.
Bosun ------------------ Bosun SCJP for the Java� 2 Platform
Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley