LinkedList
public LinkedList(Collection<? extends E> c)Constructs a list containing the elements of the specified collection, in the order they are returned by the collection's iterator. Parameters:
c - the collection whose elements are to be placed into this list.
Throws:
NullPointerException - if the specified collection is null.
public LinkedList(Collection<? extends E> c)Constructs a list containing the elements of the specified collection, in the order they are returned by the collection's iterator. Parameters:
c - the collection whose elements are to be placed into this list.
Throws:
NullPointerException - if the specified collection is null.
class B{}
...
A a = new A();
B b = new B();
LinkList l = new LinkList();
l.addFirst(a);l.removeFirst();//stack的功能
l.addFirst(b);l.removeLast();//queue的功能