In java, you can add type parameters to static methods to create methods that handle generics. Can you do the same with lambdas?
In my code I have
final private static <K,V> Supplier<Map<K, List<V>> supplier=HashMap::new;
I am trying to use type parameters such as a function, but that will not allow me.
And if I do this:
final private static Supplier<Map<?, List<?>>> supplier=HashMap::new;
It does not accept the argument in which I am trying to use it. What can I do?
source share