The above code will give you error because, The case constant expression, 1000, exceeds the range of the switch expression type, "byte". The type of a switch expression can be byte, short, int or char. A constant expression is associated with each case label. Each case constant expression must be assignable to the type of the switch expression. In this case, the switch expression, b, is of type byte; so the maximum positive value of each case constant expression is limited to the maximum byte value, 127.