为什么java不允许创建内部类的实例?
这个问题在这里已经有了答案:
所以你必须这样做,
OuterClass outer = new OuterClass();
InnerClass inner = outer.new InnerClass();
所以,就你而言,
m obj = new m();
sub1 s1 = obj.new Sub1();
链接地址: http://www.djcxy.com/p/92017.html
上一篇: Why java doesn't allow to create instance of inner class?
下一篇: Why class Node in LinkedList defined as static but not normal class