ArrayList, HashMap, and the rest are not thread-safe. If several threads modify one at the same time, data can be corrupted. The fixes, like ConcurrentHashMap, come in the concurrency days of this ...
2.3 switch 的三个经典大坑 坑一: case 穿透(fall-through) 。 Java 的 case 不加 break,会继续执行下一个 case。 有些老手说这是“特性不是 bug”,比如多个 case 共享同一段逻辑: ...