About Question enthuware.ocajp.i.v7.2.1313 :
Posted: Tue Aug 21, 2012 5:32 am
This was changed in Java 7Here are the rules:
The type of the Expression must be char, byte, short, or int, or a compile-time error occurs.
All of the following must be true, or a compile-time error will result:
The switch statement compares the String object in its expression with the expressions associated with each case label as if it were using the String.equals method; consequently, the comparison of String objects in switch statements is case sensitive. The Java compiler generates generally more efficient bytecode from switch statements that use String objects than from chained if-then-else statements.
source: http://docs.oracle.com/javase/7/docs/te ... witch.html
Just so a person doesn't automatically tick the does not compile box when then see a string.