Switch I
Beispiel I für eine switch/case-Kontrollstruktur
switch(Variable) {
case 1:
Kommandoblock 1;
break;
case 2:
Kommandoblock 2;
break;
default:
Standard-Kommandoblock;
break;
}
Anhand des Variablenwerts wird entschieden, welcher Codeblock ausgeführt wird.