in Java syntax, Class<? extends Something>

前端 未结 5 1340
遇见更好的自我
遇见更好的自我 2020-12-12 16:57

Class

Here\'s my interpretation, it\'s class template but the class ? means the name of the class is undetermined and it exte

5条回答
  •  有刺的猬
    2020-12-12 17:45

    You're correct.

    In Java generics, the ? operator means "any class". The extends keyword may be used to qualify that to "any class which extends/implements Something (or is Something).

    Thus you have "the Class of some class, but that class must be or extend/implement Something".

提交回复
热议问题