Question to supermammoth, why it not works?:
"static void processPair(B b1, B b2, BiConsumer<? extends B, ? extends B> consumer) {
consumer.accept(b1, b2);
}"
but it works?:
"List<? extends B> lb = new ArrayList<B>();
List<? super B> lc = new ArrayList<B>();"
I dont understand wildcard logic in class and methods? Why B is extends of B in one place, but not another? Why it wroks normally for super in both cases?
In common case,
is B extends B?
is B super B?


LinkBack URL
About LinkBacks
Reply With Quote