查看 Linkedlist.java,我观察到重载的构造函数,其中一个包含一个空的 this()。一般来说,我已经用默认参数看到了这一点。没有参数的 this() 有什么用?
/**
* Constructs an empty list.
*/
public LinkedList() {
}
/**
* Constructs a list containing the elements of the specified
* collection, in the order they are returned by the collection's
* iterator.
*
* @param 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) {
this();
addAll(c);
}