Given the following code:
static <U,V> List<V> map(Iterable<U> l, Function<U,V> f) {
return null;
}
I need to pass an arraylist
in the first parameter and a hash function in the second which takes a string and outputs a type int.
I'm trying the following but get the following error message.
map(names,<String,Integer> hashCode());
map(names,hash());
Error message:Not applicable for the arguments int
Need to pass a hash function so I can use this function inside the method.