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

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -