"JavaRanch, where the deer and the Certified play" - David O'Meara
"JavaRanch, where the deer and the Certified play" - David O'Meara
Originally posted by Cindy Glass:
Oh yeah,
you COULD created an instance of class A and get at the static stuff through that - but try to avoid that - it gets way to confusing to the rest of us. We then tend to forget that fact that these things are static and abuse them. There is never any reason that you HAVE to use the following syntax, but you could.
A myInstance = new A();
myInstance.i;
myInstance.getMsg();
"JavaRanch, where the deer and the Certified play" - David O'Meara
Originally posted by Cindy Glass:
There is no such thing as a static class. That would be like saying "This class is a class level class".
Static means
for a variable - there is only one per class not one per instance
for a method - that the method can be executed without the use of an instance of the class.
"JavaRanch, where the deer and the Certified play" - David O'Meara
Shiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|