区块内研社实操之CEX
case => String.intern() | Integer.valueOf() => IntegerCache
public class Flyweight {
public static void main(String[] args) {
// i 和 j 两个对象是一模一样的 => 因为有缓存 -128 - 127 都被缓存下来了
Integer i = 1;
Integer j = 1;
}}