f****m 发帖数: 38 | 1 Design and implement a static method map that takes two arguments, a “
function” f and a list l, and returns a new list generated from applying f
to each element of l. The original list l and its elements remain unchanged.
The method would be declared as follows:
public static java.util.List map(??? f, java.util.List l)
Write code to implement the map function and clearly define what ??? should
be. | g*****g 发帖数: 34805 | 2 An interface that has "function", in runtime you pass an instance of
implementation class. Check Comparator for an example.
f
unchanged.
should
【在 f****m 的大作中提到】 : Design and implement a static method map that takes two arguments, a “ : function” f and a list l, and returns a new list generated from applying f : to each element of l. The original list l and its elements remain unchanged. : The method would be declared as follows: : public static java.util.List map(??? f, java.util.List l) : Write code to implement the map function and clearly define what ??? should : be.
| f****m 发帖数: 38 | 3 thanks
【在 g*****g 的大作中提到】 : An interface that has "function", in runtime you pass an instance of : implementation class. Check Comparator for an example. : : f : unchanged. : should
|
|