List集合及泛型使用

Interface crudRobot{
        void creat(List<A> robot);
        void display(List<A> robot);
        void delete(List<A> robot, <T> t); //删除元素t
        void update(List<A> robot, <T> t); //更改元素t
}

本意是创建一个Interface crudRobot管理机器人的增删查改操作,
机器人存放ArrayList或者LinkedList里。
Interface crudRobot定义如上,
新建了一个类crueRobot继承了本来有的Robot类,
但是List robot一直被标红,
查了List的用法也没有明白是怎么回事??

讨论数量: 2

放张标红的图片看看,没看懂,你是把<A类>放进去?

1年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!