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
Get step-by-step solutions from verified subject matter experts
