There is no requirement that the case or default statements be in a particular
order, unless you are going to have pathways that reach multiple sections of the switch
block in a single execution.
A switch statement can have an optional default case, which must appear at the end of the switch.
Yes they are when they say "must appear at the end of the switch." Seems they just copied from cpp page here is link. Here is more wrong informationAleksandra Pestova wrote:Seems like they're wrong in TutorialsPoint.
Click here to seehttp://www.tutorialspoint.com/ wrote:A switch statement can have an optional default case, which must appear at the end of the switch. No break is needed in the default case.
Being Java programmer.
Being Java programmer.
Aleksandra Pestova wrote:So how is it with the default case? (Just want to be sure.)
Aleksandra Pestova wrote:For better understanding I created a block diagram of the switch statement execution.
Is it the way Java executes it?