摘要:
1 public class Test { 2 class Super { 3 int flag = 1; 4 5 Super() { 6 test(); 7 } 8 9 void test() { 10 System.out.println("Super.test() flag=" + flag) 阅读全文
摘要:
switch()函数中能放置的值为:byte,short,char,int,string,enum类型或者byte,short,char,int的包装类,其中,string类型是java7(含)之后才支持的,其他类型数据会报错, 报错信息为: Cannot switch on a value of 阅读全文
摘要:
public class SwitchCase { public static void main(String[] args) { System.out.println(switchFun(4)); //运行结果:8 } public static int switchFun(int x){ int j = 1; ... 阅读全文