I was looking at the java implementation of LinkedList, and found this:
public class LinkedList<E>
extends AbstractSequentialList<E> implements List<E>,
Deque<E>, Cloneable, java.io.Serializable
Why should a LinkedList support the Deque interface? I understand the desire to add elements to the end of the linked list, but those methods should have been incuded in the List interface.
The LinkedList
implementation happens to to satisfy the Deque
contract, so why not make it implement the interface?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With