> No.
>
> The break lable; jump is restricted to loops AFAIK.
> If it works this way, I think that the Java switch statement flow is
> unconsistent, because of the fall-through behavior (that is nothing but
> a degenerate, implicit jump to a subsequent case statement!).
No it is consistent - You are guaranteed that a switch statement will
execute from top-to-bottom and fallthrough will occur untill the switch
ends (either by reaching the end of the switch or until a break
statement is executed).
> IMHO, fall-through is too much limitative: adding
> break-to-labeled-statement statements to the switch syntax would be a
> useful and elegant extension to the current simple break statement (the
> same purpose of the ugly-but-effective 'go to' statement of C#).
This is very much like the 'goto' which IMHO is an ingredient for
spagetti code
> To be used wisely and sparingly, obviously!
famous last words
Tor Iver Wilhelmsen - 05 Oct 2006 16:27 GMT
> This is very much like the 'goto' which IMHO is an ingredient for
> spagetti code
And hence why C# has it :)
(There you need to end every case block with either a break or a "goto
case label", there is no fallthrough.)