Question: Im having issues with these two methods and was curious how they look to someone that is way more knowledgable about java than me. public
Im having issues with these two methods and was curious how they look to someone that is way more knowledgable about java than me.
public boolean remove(Object o) {
try {
remove(indexOf(o));
}
catch (IndexOutOfBoundsException e) {
throw new NoSuchElementException();
}
return true;
}
and the next method is:
public E remove(int index) {
E e = get(index);
if (index == 0) {
listHead = listHead.next;
} else {
Node node = getNode(index - 1);
node.next = node.next.next;
}
listSize--;
return e;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
