What does this Java generics paradigm do and what is it called?

后端 未结 3 1404
醉酒成梦
醉酒成梦 2020-12-18 01:10

I\'m looking at some Java classes that have the following form:


public 
abstract
class A > implements Comparable  {

           


        
3条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-18 02:05

    I believe it is usually just called a Recursive Generic Type. As Tom Hawtin points out, you probably want class A>. The most prominent use of this pattern is java.lang.Enum (which you probably knew considering you chose Comparable as your interface).

提交回复
热议问题