您的位置:首页 > 编程语言 > Java开发

New features in JDK1.7 and JDK1.8 [Need to update continually]

2014-11-19 16:01 686 查看
JDK version Features

JDK1.71, Access file system, java.nio.file.Path, File <=> Path

2, AIO

3, try with resource, resource must implements java.lang.AutoCloseable

4, switch supports String type

5, try catch, catch multi Exceptions

6, Enhance JAXB and JAXP

7, Support JDBC4.0 and JDBC4.1

JDK1.81, Interface, we can use default keyword to set a default implementation in interface

2, Interface, static keyword, interface can hold some static functions, which has function body, invoke these functions: InterfaceName.funName()

3, @FunctionalInterface, a interface has only one abstract function(except Object's functions), which can be used in Lambda expression

E.g. Runnable, Comparator, ...

4, Use :: to get reference of static method, non-static method and constructor method, which can be used in Lambda expression

5, Annotation, @Repeatable, it is used to indicate a custome interface is repeatable.

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐