switch-case语句格式如下 switch(变量){ case 变量值1: //; break; case 变量值2: //...; break; ... case default: //...; break; } swtich()变量类型只能是int.short.char.byte和enum类型.当进行case判断时,JVM会自动从上到小扫描,寻找匹配的case,可能存在以下情况: 情况一:若未找到,则执行默认的case. int i = 5; switch(i){ case 0: Sy…
package com.didispace; /** * Created by gmq on 2017/08/07. * * @version 1.0 * @since 2017/08/07 10:42 */ public class Test { public static void main(String[] args) { // switch可以使用字符串:default的本意,如果都没有匹配,则执行,所以不需要加break,当然加了也不会错误 String str = "test&quo…
function GetDepartmentName(type) { switch (type) { case DepartMentQian: alert($('#DepartMentQian').val()); break; case DepartMentHou: alert($('#DepartMentHou').val()); break; case DepartMentXiu: alert($('#DepartMentXiu').val()); break; case DepartMen…