Question: Please help the else statement I had to comment out. protected DLLEntry add (DLLEntry previousORnext, DLLEntry newEntry) { // EXERCISE // Add entry to the

Please help the else statement I had to comment out.

protected DLLEntry add (DLLEntry previousORnext, DLLEntry newEntry) { // EXERCISE // Add entry to the end of the list. (Ignore previousORnext.) // What do you do if the list is empty? (Easy!)

// What do you do if the list is not empty? (Tuesday lecture.) if(first == null) { first = newEntry; last = newEntry; } else { // last.setNext(newEntry); // // last = newEntry; }

return newEntry; }

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!