内部类 调用

package com.fh.hello1;

public class T {
    public static void main(String[] args) {
        T t = new T();
        t.new A().aHello();
        t.new A().new B().bHello();
        t.new A().new B().new C().cHello();
    }

     class A {
        public void aHello() {
            System.out.println("A hello");
        }

         class B {
            public void bHello() {
                System.out.println("B hello");
            }

             class C {
                public void cHello() {
                    System.out.println("C hello");
                }
            }
        }
    }
}
posted @ 2024-08-10 13:04  干饭达人GoodLucy  阅读(1)  评论(0编辑  收藏  举报