Originally posted by Jeff Albertson: ... Perhaps it could mean that all its fields would be implicitly static...
Okay, that would be a reasonable interpretation (and it did cross my mind when I phrased the question that way), but in this forum, we should be clear...
In Java, static essentially means "associated with the class." For fields, this means there is only one location in memory, allocated when the class is loaded. The single field stays with the class, regardless of how many instances might be created. For methods and nested class definitions, this means that there is no implicit "this" reference to the enclosing instance. For initializers, this means the code is executed when the class is loaded.
So for a top-level (non-nested) class, there is no enclosing class to associate with, and static has no meaning. [ March 29, 2006: Message edited by: marc weber ]
Rani Vish
Greenhorn
Joined: Feb 03, 2006
Posts: 22
posted
0
Thanks a Lot !!
For the Response
"associated with the class." For fields, this means there is only one location in memory,
i think this is the most suitable answer for my question
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.