/** * Created by IntelliJ IDEA. * User: gaoyong * Date: 2011-10-11 * Time: 18:23:13 * To change this template use File | Settings | File Templates. */ public class A{ public void getA(){ System.out.println("主类getA()方法"); } class B{ public void getA(){ System.out.println("内部类调用getA()方法"); A.this.getA(); } } public static void main(String[] args) { A a=new A(); a.new B().getA(); } }
* Created by IntelliJ IDEA.
* User: gaoyong
* Date: 2011-10-11
* Time: 18:23:13
* To change this template use File | Settings | File Templates.
*/
public class A{
public void getA(){
System.out.println("主类getA()方法");
} class B{
public void getA(){
System.out.println("内部类调用getA()方法");
A.this.getA();
}
} public static void main(String[] args) {
A a=new A();
a.new B().getA();
}
}