Generic Lower bounded Method
问题 Let's say I have the following classes Animal , Fish , and CatFish . CatFish extends Fish and Fish extends Animal . There is a generic class called MyPets , which has a type parameter (generic) called T , and that will be parameterized with the above classes' objects. My question is, how do I create a lower bounded method in D that will take any objects that is a PARENT class of the CatFish class. 回答1: You can't. TL;DR: Type parameters can have several bounds, like in class Box {...} . But a