class Person { public static int count = 0; public Person() { // 统计Person2创建的实例个数 count = getCount() + 1; } public static int getCount() { return count; } }
Sign in to make a reply
中二少年阿鹏