Hi Fellas, What exactly does "Static" convey? What are the limitations in accessing any variable/method/class designated as "Static"? Awaiting a dynamic response, Yogi.
Joined: Mar 17, 2001
Hi Static methods are universal for JVM and can be implemented without instantiation of classes where the static method was implemented. Static methods cannot access instance variables as they exist for particular instances.
Marilyn de Queiroz
Joined: Jul 22, 2000
static data belongs to the class, not an individual object of the class. There is exactly one instance of static data, regardless of how many instances of the class there are.
static methods (aka class methods) do class-wide operations and do not apply to an individual object. You can call a static method by prefixing it with the name of an object or the name of the class (preferred)
static block is a block of code prefixed by the keyword static. It must be inside a class and outside all methods. It is executed when the class is first loaded into the JVM.
a static class (aka nested top-level class) is the declaration of an entire class as a static member of another class.
JavaBeginnersFaq "Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Joined: Jan 07, 1999
Strictly there is one instance of a static item for each classloader used to load the class. This doesn't usually matter, but for applications with multiple classloaders (eg. servlet containers, auto-loading test harnesses etc.) this can be a big issue.