package com.liming.statictest;
import org.junit.Test;
public class StaticTest {
@Test
public void main(){
A a1 = new A();
//创建内部类对象
A.BB.BBB a3 = new A().new BB().new BBB();
//调用静态内部类成员
A.AA.AAA.test();
}
}
class A{
static int sa;
int a;
//静态内部类
static class AA{
static class AAA{
static void test(){
System.out.println("Test programming");
}
}
}
//普通内部类
class BB {
class BBB {
}
}
}
内部类与静态内部类的使用
最新推荐文章于 2025-06-18 17:33:39 发布