Java、ConcurrentLinkedDeque 与 ConcurrentLinkedQueue - 区别是什么?

Java, ConcurrentLinkedDeque vs ConcurrentLinkedQueue - the difference?

Api ConcurrentLinkedDequeConcurrentLinkedQueue 的链接:

http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ConcurrentLinkedDeque.html

http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ConcurrentLinkedQueue.html

两者有什么区别?

第一个,DeQueue的方法比较多,但是两者的根本区别是什么?

两个集合都是线程安全的。不同之处在于 ConcurrentLinkedDeque 实现了 Deque, which supports addition and removal of elements at both ends (e.g. addFirst and addLast), whereas ConcurrentLinkedQueue implements a Queue,它允许在称为队列尾部的一端插入并在另一端删除,称为队列头。

双端队列允许从队列的两端插入和删除,这就是为什么有很多方法。

而队列没有。