top
就 JDK 實作看起來是這樣沒錯

TOP

IntegerCache 不會有實例,它是 private static class IntegerCache,在 Integer 中都是直接使用其 static 方法 …

你想問的大概是 IntegerCache 中的 static 區塊何時執行,cache 何時會參考到陣列並建立範圍內的 Integer 物件,預設應該是初次載入 IntegerCache 對應的 .class 時,會執行 static 區塊 …

TOP