更新:我的课程比这更复杂,我只是卡在 ArrayList 行
我有以下课程:
class CatList {
    List<Cat> cats = new ArrayList<Cat>();
}
和
class DogList {
    List<Dog> dogs = new ArrayList<Dog>();
}
其中 Cat 和 dog 都是数据类。
但我想创建一个抽象类:
abstract class AnimalList {
    List<???> animals;
    AnimalList(Class animal) {
        animals = new ArrayList<???>();
    }
}
这样我就可以继承我的类
AnimalList CatList = new AnimalList(Cat);
AnimalList DogList = new AnimalList(Dog);
AnimalList CowList = new AnimalList(Cow);
希望这更有意义。因此,我的问题是什么是???位?