class Loo{
int a;
static int b;
Loo(){
a++;
b++;
}
void show(){
System.out.println("a="+a);
System.out.println("b="+b);
}
}
public static void main(String[] args) {
Loo o1=new Loo();
o1.show();
Loo o2=new Loo();
o2.show();
}
为什么 两次的b值不一样,两次的a值是一样的?
求讲解static{}方法。