Search code examples
javaabstract-data-type

What concrete data type implements abstract data type structure in Java?


Because a queue is an abstract data type data structure, what concrete data type structure implements it? I saw that a queue is an interface so was unsure how a concrete data type could implement the abstract data type structure.


Solution

  • Read the Javadoc for Queue. Notice the seventh line from the top:

    All Known Implementing Classes:

    There you will find a list of implementations bundled with any implementation of Java.

    AbstractQueue, ArrayBlockingQueue, ArrayDeque, ConcurrentLinkedDeque, ConcurrentLinkedQueue, DelayQueue, LinkedBlockingDeque, LinkedBlockingQueue, LinkedList, LinkedTransferQueue, PriorityBlockingQueue, PriorityQueue, SynchronousQueue

    Third-parties offer implementations as well. For example, Google Guava has implementations such as EvictingQueue. And Apache Commons offers implementations such as CircularFifoQueue.

    And you can make your own implementation if need be.