一.定义 integral promotion: "A character, a short integer, or an integer bit-field, all either signed or not, or an object of enumeration type, may be used in an expression wherever an integer may be used. If an int can represent all the values of the o
转自:http://www.hollischuang.com/archives/61 Java7中switch中支持的数据类型有: byte short int char String类型 其实switch是只支持一种数据类型,那就是整型: 1. byte short int 本身就是整型,可以直接按照整型进行比较 2. char的字符会依照ascii表,转换为对应的整型,然后进行switch条件选择 3. String的字符串会 先将字符串转换为hash值, 然后再对字符串进行equa