22 lines
498 B
Plaintext
22 lines
498 B
Plaintext
== Exceptions
|
|
|
|
This rule is relaxed in the following cases:
|
|
|
|
|
|
----
|
|
switch (myVariable) {
|
|
case 0: // Empty case used to specify the same behavior for a group of cases.
|
|
case 1:
|
|
doSomething();
|
|
break;
|
|
case 2: // Use of return statement
|
|
return;
|
|
case 3: // Use of throw statement
|
|
throw new IllegalStateException();
|
|
case 4: // Use of continue statement
|
|
continue;
|
|
default: // For the last case, use of break statement is optional
|
|
doSomethingElse();
|
|
}
|
|
----
|