文章列表
我也不太清楚,先看代码吧;
class X {
private static X instance = new X();
int a = 1;
{System.out.println(a);}
// static int b;
static int b = 2;//2
static {System.out.println(b);}
private X() {
super();
a = 5;
b = 6;
}
public static X getInstance(){
return instance;
...