Differences from JDK 1.6 (JavaSE6)
[From JDK 1.7 (Java 7 / SE7)] ・ Binary numbers (starting from 0b) can be used for integer literals ・ Underscore can be used for numerical literals -The case string can be used in the Switch statement -Diamond operator <>: Type arguments can be omitted when instantiating a class ・ You can rethrow the exception in catch {} of try ~ catch. -Try statement with resources (try-with-resources): try (type variable = initialization) -Multi-catch of exceptions: catch (Exception A | Exception B)
[From JDK 1.8 (Java 8 / SE8)] ・ Lambda type -Omission of final: It is not necessary to add final to a variable that is practically final. -Method reference: Class name :: Method name ・ Specify multiple same annotations in one place -Functional interface -Date / time API: The package has changed. Date, Calendar, DateFormat → time * This is a very different point
I don't like the fact that it seems to be difficult.
I referred to the following site. New Java Features (Changes in Java)
Recommended Posts