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

php - Wordpress: Link a post to posts of another category manually -

javascript - Complete OpenIDConnect auth when requesting via Ajax -

apache - PHP Soap issue while content length is larger -