Add meaningful toString() methods

This commit is contained in:
Eric Scharff 2007-10-11 16:41:07 -06:00
parent 00cfa587bc
commit 9d3027540b
2 changed files with 8 additions and 0 deletions

View File

@ -174,4 +174,8 @@ public class ArrayList<T> implements List<T> {
public ListIterator<T> listIterator(int index) {
return new Collections.ArrayListIterator(this, index);
}
public String toString() {
return Collections.toString(this);
}
}

View File

@ -196,6 +196,10 @@ public class LinkedList<T> implements List<T> {
return new MyIterator(front);
}
public String toString() {
return Collections.toString(this);
}
private static class Cell<T> {
public T value;
public Cell<T> prev;