私人内部阶级

时间:2015-11-06 18:49:10

标签: class methods call private

package package1;

public class Test {

    public static void main(String[] args) {
        // TODO Auto-generated method stub

        System.out.println("Hi banda");     
        Test n = new Test();
        Test1 t = n.new Test1();
        t.show();
        // Test1 t1 = n.Test1.show();
    }

    private class Test1{
         int l = 10;
         void show() {
            System.out.println("inner class" + l);
        }       
    }

}

如何查看show()输出

0 个答案:

没有答案