一 java 7
1. switch 不仅仅可以接受数字 还可以接受字符串
2 异常的捕获
before
now
3 泛型
before
List<String> stringList = new ArrayList<String>();
now
List<String> stringList = new ArrayList<>();
4 数字
before
int num1 = 123456;
now
int num2 = 123_456;
说明
num1 = num2
5 文件的读取
before
now
说明
流可以自动关闭
6 方法可以接受变长变量
public static void doSomeCase(int... a){
}
说明
可以传多个变量
此时的 a 是个int[] 类型的变量
doSomeCase(1,2,3,4,5,6);