在 Switch 中使用 String

从 Java 7 开始,可以在 switch case 中使用字符串,但这仅仅是一个语法糖。

内部实现在 switch 中使用字符串的 hash code。

最后更新于