error in overriding generic collections in Java

前端 未结 5 1840
隐瞒了意图╮
隐瞒了意图╮ 2021-01-28 19:29

When I try to override a method that takes a List, I get the following compile error.

Multiple markers at this

5条回答
  •  时光取名叫无心
    2021-01-28 19:47

    List and List are different types and getname(List num) and getname(List num) are methods with different signatures. So the second doesn't override the first. So child can not extends parent whit this method.

提交回复
热议问题