最近在整理JDK1.8相关改动升级,整理到容器这里,发现改了很多东西,目前已知的改动是hashMap和concurrentHashMap,请问除了这两个还有其他修改吗?提前感谢!
回答:
#### [Collections](http://docs.oracle.com/javase/8/docs/technotes/guides/collections/changes8.html)
* Classes in the new `java.util.stream` package provide a Stream API to support functional-style operations on streams of elements. The Stream API is integrated into the Collections API, which enables bulk operations on collections, such as sequential or parallel map-reduce transformations.
* Performance Improvement for HashMaps with Key Collisions
回答:
建议查阅官方的release note吧,我也就只清楚最有名的这两个做了改动。
回答:
改了很多东西,很多容器都添加了新方法,用的更方便。
另外为了支持流类库,所有容器还实现了stream接口,因为要兼容以前的代码,还添加了一项新特性叫默认接口实现。
如果有兴趣的话,你还可以用反射看看Java8新增了那些函数,我看了一下有个Reflection库,可以方便一点。
回答: