public class InnerDemo {
public void methed(){
final int m = 15;
class Inner{ //不加private没问题,加了报错,是什么问题呢
public void show(){
System.out.println(m);
}
}
Inner i=new Inner();
i.show();
}
public void show(){
InnerDemo demo = new InnerDemo();
demo.methed();
}
public static void main(String[] args) {
InnerDemo demo = new InnerDemo();
demo.show();
}
} |
|