Question: All this is done in Java. So we have to edit a singly linked list and have to add the GET and SET methods so
All this is done in Java. So we have to edit a singly linked list and have to add the GET and SET methods so far I have tried the get method only but I get: "The value at location 2 is: DHSingleLinkedList$Node@1175e2db" from the driver. The get part from my driver method is
Object value = list.get(2); System.out.println("The value at location 2 is: " + value); Here is the get method that I wrote:
public E get(int index) { int n = 0; if (n > size) { return null; } Node
Most of the methods are already created the only thing needed is get and set but I need help fixing my get method so far.
public void add(int index, E item); public E remove(int index); public E get(int index); public E set(int index, E newValue); public int size();
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
