About Question enthuware.ocpjp.v8.2.1293 :
Posted: Sun Aug 05, 2018 10:56 am
Hi Admin
I bring this up only because otherwise one might be tempted to read your statement as "any appearance of ? on the RHS of = is illegal syntax and will not compile."
Thanks.
This compiles:You cannot have a '?' on the right hand side. I.e. you must provide a type name while instantiating a typed class.Code: Select all
HashMap<?, List<String>> box = new HashMap<?, List<String>>();
Code: Select all
HashMap<?, List<?>> box = new HashMap<Integer, List<?>>();
Thanks.