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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!