implement HashSet.toString

This commit is contained in:
Joel Dice 2008-08-22 14:02:38 -06:00
parent c8cc7d931b
commit 9017b5996a

View File

@ -66,6 +66,10 @@ public class HashSet<T> implements Set<T> {
return new MyIterator(map.iterator());
}
public String toString() {
return Collections.toString(this);
}
private static class MyIterator<T> implements Iterator<T> {
private final Iterator<Map.Entry<T, Object>> it;