feat: add size() method to MyLinkedList

This commit is contained in:
Гаджикурбанов Темирлан
2026-08-24 00:49:43 +03:00
parent a7861dd58a
commit 9e8fc5effb
@@ -69,7 +69,14 @@ public class MyLinkedList<T> implements MyList<T>
temp = temp.getNext();
}
T oldValue = (T) temp.getValue();
temp.setValue(value);
return oldValue;
}
public int size() {
return size;
}
public String toString() {
Object[] res = new Object[size];
int index = 0;