Skip to content
Advertisement

Tag: bounded-wildcard

Not able to create generic bounded class objects with interface

I am trying to use bounded types with generics to create generic objects of subclasses (these implement an interface). But I am getting type mismatch errors when initializing objects with the subclasses. Here is the interface: Here’s the class that implements this interface: Now I created 2 classes (SegmentPageScanResult and ItemProcessor) with the bounded generic type as: and When I

Advertisement