Why generic type is not applicable for argument extends super class for both?

后端 未结 5 1160
迷失自我
迷失自我 2020-12-03 17:44

Here is the problem that I have been being tried to find the solution.

We have two class definitions. One of two extends other one.

    class T{}         


        
5条回答
  •  一个人的身影
    2020-12-03 18:23

    An addition to the other answers posted here, I would simply add that I only use wild cards for method parameters and return types. They're intended for method signatures, not implementations. When I put a wildcard into a variable declaration, I always get into trouble.

提交回复
热议问题