Why do some books include double quotes here?
It can run with or without addition, is there any difference?
怪我咯2017-05-27 17:43:47
Theoretically there is no difference, each case is an independent code block
滿天的星座2017-05-27 17:43:47
The statements in the case block are not actually the focus. As long as you reach this branch, you can just execute it. As for the problem of {} and double quotes you mentioned, adding {} means it is a block. Adding double quotes should be a string. , generally note that the case value of switch is generally of byte, char, short, int or enum type. The String type is supported after JDK1.7.