JDK version | Features |
JDK1.7 | 1, 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.8 | 1, 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. |