feat: add an isEmpty() method that allows you to check whether the colle
This commit is contained in:
@@ -77,6 +77,10 @@ public class MyLinkedList<T> implements MyList<T>
|
|||||||
public int size() {
|
public int size() {
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
public boolean isEmpty()
|
||||||
|
{
|
||||||
|
return size == 0;
|
||||||
|
}
|
||||||
public String toString() {
|
public String toString() {
|
||||||
Object[] res = new Object[size];
|
Object[] res = new Object[size];
|
||||||
int index = 0;
|
int index = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user