- public class A {
- public static class B {
- public void fun() {
- System.out.println("OK");
- }
- }
- public class C {
- public void fun() {
- System.out.println("OK");
- }
- }
- public static void main(String[] args) {
- A a = new A();
- A.B ab = new A.B();
- A.C b = a.new C();//成功
- A.C c = new A().new C();//成功
- }
- }
关于创建静态内部类的对象的理解代码
最新推荐文章于 2022-09-30 00:18:02 发布