JDK7增強特性介紹

jieforest發表於2012-07-21
[i=s] 本帖最後由 jieforest 於 2012-7-21 11:44 編輯

I believe most of the Java Developers are aware of the latest Java release i.e Java 7. Lot of us are disappointed about quite a few important features being deferred to Java 8, but its really good to see the language evolving and lot of things happening in the Java community.
You must have seen plethora of articles on try-with-resources, strings in switch statements and other minor language enhancements as part of Project Coin.

These are just few of the enhancements added to the release. There are few other API enhancements which are good to know, for example new Files API in java.nio package, watching directory changes, Fork-Join framework.

I went through few of those topics and blogged about them and I thought it is best to aggregate them here for the benefit of the readers.

Fork-Join Framework:
In Java 5 java.util.concurrent package was added with lot of new classes for developing concurrent applications- Executor, ExecutorService, Callable, Futures among others. Fork-Join framework was added in Java 7 which builds on top of ExecutorService and adds task stealing algorithm in which the tasks queued in one thread can be picked by ideal threads and this facilitates creating multiple tasks and not worrying about tasks not getting executed.
1. A brief overview of Fork-Join framework can be found here.

2. Implementing mergesort algorithm using ForkJoin framework can be found here.



來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/301743/viewspace-736203/,如需轉載,請註明出處,否則將追究法律責任。

相關文章