其他分享
首页 > 其他分享> > 写代码被打死系列

写代码被打死系列

作者:互联网

interface Out{
}
class Outer {
    //成员内部类
    private String name ="123";
    private int id ;
        class inner{
            String name = Outer.this.name ;
            int id = Outer.this.id;
        }
        public Out test(int id )  {
            //局部内部类
            class inner2 implements Out{
                int id = Outer.this.id ;
                int id2 = this.id;
            }
            return new inner2();
        }
    public static void main(String[] args) {
        Outer outer = new Outer();
        inner inner = outer.new inner();
        Out test = outer.test(1);
    }
}

标签:打死,Outer,int,代码,outer,inner,系列,id,Out
来源: https://blog.csdn.net/weixin_42000850/article/details/110342375