Issue
What is the difference between the two in Java? Is it just that blocking deque uses an array and linked blocking deque uses a linked list? I want to know this so that I can make a decision about which data structure I want to use for my audio track queue.
Solution
java.util.concurrent.BlockingDeque
is an interface, and java.util.concurrent.LinkedBlockingDeque
is a concrete class implementing that interface. In fact, it is the only (public) implementation of BlockingDeque
in the JavaSE API, so there is no choice to make (unless you want to implement your own or find another library implementing another BlockingDeque
).
See also What does it mean to program to an interface?
Answered By - Mark Rotteveel
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.