class Chinese
{
private static int count=0;
private static String country="中国";
String name;
int age;
public Chinese()
{
System.out.println(++count);
}
}
class TestChinese
{
public static void main(String[] args)
{
new Chinese();
new Chinese();
new Chinese();
}
}
程序打印出是1 2 3,但如果count不是static的,为什么打印的都是1呢?视频上听的不太懂? |
|