Lecture 11 Objectives


At the end of today's class you should

KNOW:

BE ABLE TO:

Sample Exam Question:

Here is a method:

// produce a list of the dillos in the given list, brought back to life
LinkedList<Dillo> reviveAllDillos(LinkedList<Dillo> dilloList){
  LinkedList<Dillo> aliveDillos = new LinkedList<Dillo>();
  
  for (Dillo d:  dilloList){
    aliveDillos.add(new Dillo(d.length, true));
  }
  
  return aliveDillos;
}
Create a Function object that transforms a dillo from its current state (either dead or alive) to alive. Then rewrite the given function using a Function parameter. Finally, call your rewritten method with your Function object.