implement TreeSet.toString()

This commit is contained in:
Joel Dice
2007-10-16 19:17:37 -06:00
parent 3779f21424
commit f84b865f03
2 changed files with 6 additions and 2 deletions

View File

@ -3,10 +3,10 @@ package java.util;
public class Collections {
private Collections() { }
static String toString(List l) {
static String toString(Collection c) {
StringBuilder sb = new StringBuilder();
sb.append("[");
for (Iterator it = l.iterator(); it.hasNext();) {
for (Iterator it = c.iterator(); it.hasNext();) {
sb.append(it.next());
if (it.hasNext()) {
sb.append(",");