1.关于switch语句的知识点:
-
char、short、int、long、bool 基本类型都可以用于switch语句。
-
float、double都不能用于switch语句。
-
enum类型,即枚举类型可以用于switch语句。
-
所有类型的对象都不能用于switch语句。
-
字符串也不能用于switch语句
1.关于switch语句的知识点:
char、short、int、long、bool 基本类型都可以用于switch语句。
float、double都不能用于switch语句。
enum类型,即枚举类型可以用于switch语句。
所有类型的对象都不能用于switch语句。
字符串也不能用于switch语句