switch String支持底层实现
switch (type) {
case "hello":
System.out.println("hello");
break;
case "world":
System.out.println("world");
break;
}
switch (type) {
case "hello".hashcode:
if ("hello".equals(type)) {
System.out.println("hello");
}
break;
case "world".hashcode:
if ("world".equals(type)) {
System.out.println("world");
}
break;
}