You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
708 B
44 lines
708 B
---
|
|
Java 5 - Java 10 新特性总结
|
|
---
|
|
|
|
#### 思维导图
|
|
|
|
##### Java 5
|
|
|
|
1. 泛型
|
|
2. 注解
|
|
3. 枚举
|
|
4. 增强循环(for-each)
|
|
5. 自动装箱/拆箱
|
|
6. 可变长参数
|
|
7. 静态导入
|
|
|
|
##### Java 6
|
|
|
|
##### Java 7
|
|
|
|
1. Switch 中可以使用字符串
|
|
2. 泛型实例化类型自动推断
|
|
3. Try-with-resources 和 AutoCloseable
|
|
4. Try-catch 可以可捕获多个异常
|
|
|
|
##### Java 8
|
|
|
|
1. 接口可以有默认方法(default 关键字)
|
|
2. Lambda 表达式
|
|
3. 可重复注解(@Repeatable)
|
|
4. HashMap 改进
|
|
|
|
##### Java 9
|
|
|
|
##### Java 10
|
|
|
|
1. 局部变量类型推断(var)
|
|
|
|
##### Java8 以后可参考
|
|
|
|
[聊聊 Java8 以后各个版本的新特性](https://juejin.im/post/6844903918586052616)
|
|
|
|
|
|
|
|
|