欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

J2SE Evolution 博客分类: Java Foundation javaj2senew-featuresjava7java8

程序员文章站 2024-03-09 14:54:23
...
Java 7 New Features

Java SE 7 Features and Enhancements:
http://www.oracle.com/technetwork/java/javase/jdk7-relnotes-418459.html
A look at Java 7's new features:
http://radar.oreilly.com/2011/09/java7-features.html





Concurrency Utilities Enhancements & Fork/Join:
http://docs.oracle.com/javase/tutorial/essential/concurrency/forkjoin.html


Strings in switch Statements:
http://docs.oracle.com/javase/7/docs/technotes/guides/language/strings-switch.html
引用
String.equals 作为比较的依据,并且字符串是大小写敏感的


Objects 工具类,使用举例如下:
Objects.requireNonNull(someObject);
someObject.doCalc();



Generics 声明时使用 Diamond Operator <>:
http://docs.oracle.com/javase/7/docs/technotes/guides/language/type-inference-generic-instance-creation.html
before:
Map<String, List<String>> anagrams = new HashMap<String, List<String>>();
now:
Map<String, List<String>> anagrams = new HashMap<>();



Underscores in Numeric Literals:
http://docs.oracle.com/javase/7/docs/technotes/guides/language/underscores-literals.html
Binary Literals 二进制整数:
http://docs.oracle.com/javase/7/docs/technotes/guides/language/binary-literals.html
Underscores in Numeric Literals & Binary Literals 可参见本:
http://wuaner.iteye.com/admin/blogs/1668172


Java 8 New Features


http://www.oracle.com/technetwork/java/javase/8-whats-new-2157071.html