需要问的问题如标题,麻烦各位说的详细点!

解决方案 »

  1.   


    public class Test {
        private void show() {
            System.out.println("Show");
        }
        private void print() {
            System.out.println("Print");
        }    class InnerC {
            public void print() {
                show();              // 如果不重名,直接调用
                Test.this.print();   // 如果重名了,要加上外部函数的名字,加上this
            }
        }
        
        public void p() {
            InnerC c = new InnerC();
            c.print();
        }
        public static void main(String[] args) {
            Test t = new Test();
            t.p();
        }
    }
    楼主,给你个简单的例子吧,里面调外面,直接调用就行!