The value type of switch condition variable

The value type of switch condition variables are mainly the following six:

1) Before the JDK1.5 (excluding the JDK1.5) only byte , Short , int , char type, can not float, double, long, boolean type.

2) JDK1.5 and later increased the enumeration type.

3) JDK1.7 and later increased the String type.

The value type of switch condition variables can not exceed more than six types, or an error occurs.

Guess you like

Origin www.cnblogs.com/sinoaccer/p/12004793.html