Java - Interface extending itself

后端 未结 5 1244
灰色年华
灰色年华 2021-02-20 13:53

I\'ve been using this site for about 6 months now, and its time to ask my first question, because I cant find the answer to this, atleast not an answer that I can understand!

5条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-20 14:12

    In the first case, you have bounded your generic type parameters to be subtype of the interface itself, whereas, in the second case, you can have any type as generic type parameter. So, they are potentially different declarations.

    For example, you can define a reference like:

    PositionedVertex
    

    for the 2nd interface type, but not for the 1st one.

提交回复
热议问题