About Question enthuware.ocpjp.v21.2.3312 :
Posted: Sun Sep 21, 2025 2:23 pm
List<? super Dooby> dV implies that dV must point to a List of some super class of Dooby. It could be a List of Dooby, Booby, or Object. which means instead of a List, a single object of type Dooby, Booby, or an Object can be added too. And so if we give one answer as
dV.add(new Dooby(){ }); (choice a),
then why is that incorrect?
dV.add(new Dooby(){ }); (choice a),
then why is that incorrect?