0
What does it mean if a class is declared as static?
I know that variables in a class declared as static is to be shared by all instances of that class, but what does it mean when a class is declared as static?
3 ответов
+ 4
imagine a nested classes.
class Outer{
class Inner { }
}
in this case you'll need an instance of Outer to create an instane of Inner.
new Outer().new Inner()
looks ugly right ? if you declare Inner as static you'll only need the Class just like a static method/variable
new Outer.Inner()
0
Taste Ah I see, that makes me more enlightened now. Thank you, very appreciated.