Do you have any other name that should be used rather than the name "static"? I just would like to know your personal opinion on its name...
Hi Ko Ko,
Well, you have put your finger on the key issue! It is a lot easier for me or you or anyone
to point out a flaw, than it is to provide a solution which is obviously better.
We are looking for a word that suggests "unlike all the other fields, this one is not part
of an object". A word like "independent" or "class-level" or even "belongs-to-class"
could possibly suggest that.
It would also be good if the same word could be used with static blocks to suggest
"there is only one of these", perhaps a qualifier like "one_time" or something.
Or maybe there could be a special section in a class labelled as the "belongs_to_class" or
"one_only_for_the_whole_class"
section in which all the static things go. Or maybe we should have the special section
called "one_for_each_object" and it contains all the non-static things. Or maybe have both
sections and try to find shorter names for them.
There probably isn't a perfect solution for this, but I still think "static" (the name) sneaked
into Java from C, when it should not have even been in C (as a name, not a feature) in the
first place!
Do other people have any suggestions on changing this name to make it easier to understand?
Cheers,
Peter