内部类调用
public class DotThis { //内布类 public class Inner { public int outer(int a ,int b) { return a+b; }; } //调用内部类 public static void main(String[] args) { Inner inner = new DotThis().new Inner();
System.out.print(inner.outer(1, 2)); } }
在main函数里面调用new 内部类必须是由主类调用的!!!!!