Synopsis: | The default label should be the last label in a switch statement |
Language: | Java |
Severity Level: | 3 |
Category: | Design |
Description: |
By convention, the default label should be the last label in a switch statement.public class Foo { void bar(int a) { switch (a) { case 1: // do something break; default: // the default case should be last, by convention break; case 2: break; } } } |