Generic wildcards in java. Compile error. -
i have following java code: box<? extends integer> = new box<integer>(); i.set(10);
. why not compile?
because box<? extends integer>
can box<somesubtypeofintegernotincluding10>
. want box<integer>
instead.
Comments
Post a Comment