Whats the use of this() in linkedlist.java
Looking at Linkedlist.java, I observe overloaded constructors, one of
which contains an empty this(). Generally I have seen this with default
params. Whats the use of this() with no params in it ?
/**
* 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);
}
No comments:
Post a Comment