Archive for April 9th, 2008
switch statement- Java
Why should switch statement ever fall through?
That is if we don’t give a break; in switch case the program flow goes to the next cases and executes them also.
Wonder why this redundant break; needs to be given.When the idea is to do switch case statement something like if else if statement.
we could have it like : if at all the programmer needs the flow to fall through to next case why don’t they specifically say a continue;
