Normal
break; "bricht" die ausführung von switch ab.Solange kein break kommt, wird von oben nach unten alles ausgeführt.bei x = 4 würde es also alles ausführen bis zum break:[code=Java] case 4: y *= 3; case 3: y += 3; case 2: ++y; case 1: y++; break;[/code]
break; "bricht" die ausführung von switch ab.
Solange kein break kommt, wird von oben nach unten alles ausgeführt.
bei x = 4 würde es also alles ausführen bis zum break:
[code=Java] case 4: y *= 3;
case 3: y += 3;
case 2: ++y;
case 1: y++; break;[/code]