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

javascript - Complete OpenIDConnect auth when requesting via Ajax -

c# - Replace text in MailItem Body -

java - Get more than One value and display it -