Why java doesn't allow to create instance of inner class?
This question already has an answer here:
So you have to do something like this,
OuterClass outer = new OuterClass();
InnerClass inner = outer.new InnerClass();
So, in your case,
m obj = new m();
sub1 s1 = obj.new Sub1();
链接地址: http://www.djcxy.com/p/92018.html
上一篇: Java访问静态嵌套类
下一篇: 为什么java不允许创建内部类的实例?