java内部类与静态内部类

java内部类与静态内部类

 

static class Outer {
    class Inner {}
    static class StaticInner {}
}

Outer outer = new Outer();
Outer.Inner inner = outer.new Inner();
Outer.StaticInner inner0 = new Outer.StaticInner();

精选部分回答,便于理解

 

 

 

 参考:https://www.zhihu.com/question/28197253

posted @ 2022-02-18 14:12  蜗牛coder  阅读(36)  评论(0编辑  收藏  举报