Can a static nested class be instantiated in Java?

后端 未结 4 1835
滥情空心
滥情空心 2020-12-23 21:25

From Oracle\'s Java tutorials I\'ve found this text:

As with class methods and variables, a static nested class is associated with its outer class. An

4条回答
  •  囚心锁ツ
    2020-12-23 21:48

    Static nested classes are themselves not static at all. In java, no class is static. Static keyword in static nested classes implies that it is another static member of the outer class. But it is just another raw class . Thats why we can instantiate this class

提交回复
热议问题