Java Generics With a Class & an Interface – Together

I want to have a Class object, but I want to force whatever class it represents to extend class A and implement interface B.

I can do:

Class<? extends ClassA>

Or:

Class<? extends InterfaceB>

but I can’t do both. Is there a way to do this?

3 Answers
3

Leave a Comment