Skip to content

Commit e4e6db9

Browse files
armeetjphrdang
andauthored
Update src/com/codefortomorrow/advanced/chapter16/solutions/LinkedList.java
Co-authored-by: Rebecca Dang <35876322+phrdang@users.noreply.github.com>
1 parent 8017009 commit e4e6db9

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/com/codefortomorrow/advanced/chapter16/solutions/LinkedList.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ public String toString() {
114114
current = current.getNext();
115115
} while (current != null);
116116

117+
// Remove trailing comma and space after last list element
117118
list = list.substring(0, list.length() - 2);
118119
return list + "]";
119120
}

0 commit comments

Comments
 (0)