
本文共 2801 字,大约阅读时间需要 9 分钟。
������������������������������������������������������������������������������������������������������������������
���������������������������������������������������
���������������������������������������������������������������������������������������������������������/������������������������������������������������������������������
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
������������������������������������ squel ©foreground declare������������������������������������������������ modifier.��������������������������� squel ©foreground declare������������������������������
������������������������������������������������������������������������������������������������������������������������������������������������������������
������������������������������������
- ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
-
������������������������������������������������������������������������������������������
-
������������������������������������������������������������������������������������
-
���������������������������������������������������������������������������������������������������������������������������
���������������
public class Outer {
static { System.out.println("load outer class..."); }static class StaticInner { static { System.out.println("load static inner class..."); } static void staticInnerMethod() { System.out.println("static inner method..."); } } public static void main(String[] args) { Outer outer = new Outer(); System.out.println("===========���������==========="); Outer.StaticInner.staticInnerMethod(); }
}
���������������
load outer class...
���������... load static inner class... static inner method...���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������
public class Singleton {
private Singleton() {}static class SingletonHolder { private static final Singleton instance = new Singleton(); } public static Singleton getInstance() { return SingletonHolder.instance; }
}
������������������������������������
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������-sensitive������������������������������������
发表评论
最新留言
关于作者
