Interface List - java

后端 未结 2 1102
小鲜肉
小鲜肉 2021-01-28 14:27

We have been asked to replace ArrayList and use interface List instead in two classes. I\'ve been trying but to no avail. If someone could help with one of the classes to show h

2条回答
  •  甜味超标
    2021-01-28 14:50

    Change abstract public void act(ArrayList newAnimals); to abstract public void act(List newAnimals);

    and in method body do newAnimals = new ArrayList();

提交回复
热议问题