LinkedList in Java for Beginners Part 4 : getSize and toString Method

preview_player
Показать описание
Learn how to implement the getSize and toString method of a dummy singly linked list for Beginners
Рекомендации по теме
Комментарии
Автор

Thank you so much, your videos are so helpful for java dummies like me!!!

hantran
Автор

public String toString() {
StringBuilder sb= new StringBuilder();
Node n= head;
while(n!=null) {
sb.append(n);
n=n.next;
}

return sb.toString();
}


When I print using this method, it print the hashcode of each node. Why is it behving like this?

mehrosenasir