xmhky 原创图解 · 更新于 2026-09
每 new 一个对象就 +1,靠的就是 static 变量全类共享。
public class Counter {
getCount()
count++