For Java Certification Exam (OCJP) Practice Questions, refer

What is a LinkedList?

LinkedList is a doubly-linked list implementation of the List and Deque interfaces. It does not support fast random access of elements.

What are the super types of LinkedList?

The LinkedList class implements the List and Deque interfaces. The Deque interface extends the Queue interface. Queue and List interfaces extend Collection interface.
Hence, it is possible to assign a LinkedList object to a variable of type Deque, List, Queue or Collection. So the following assignments are legal.

Deque<Integer> deque = new LinkedList<>();
List<Integer> list = new LinkedList<>();
Queue<Integer> queue = new LinkedList<>();
Collection<Integer> collection = new LinkedList<>();

For more details on LinkedList, please refer

Leave a Reply

Your email address will not be published. Required fields are marked *