This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
When you have multiple cases in a switch block, you are only indicating to the JVM where it should BEGIN execution. Once the JVM finds a matching case (meaning the JVM has found the correct entry point), it will just execute all the code below as normal, as though the case keywords are not there.
So to conclude, the "case" keyword is NOT meant for instructing the JVM to perform only this particular snippet of the switch block. It only serves as an entry point of the switch block. Nothing else. If you DO want to force the JVM to perform only this particular code snippet (meaning only statements linked to the matching case), the ONLY way is to use "break".
Anyone, please feel free to correct me if I'm wrong. [ January 15, 2005: Message edited by: Liang Anmian ]
Current Status:<br /> <br />SCJP 1.4<br />SCJD (in progress)