Switch statement with enumeration


Source code

1class SwitchStatementWithEnumeration {
2
3 int m(Enumeration en) {
4 switch (en) {
5 case ONE:
6 return 1000;
7 case THREE:
8 return 3000;
9 case TWO:
10 return 2000;
11 default:
12 return 0;
13 }
14 }
15
16}

Bytecode




Java compiler version: 21
Other examples
Main page