in Java syntax, Class<? extends Something>

前端 未结 5 1351
遇见更好的自我
遇见更好的自我 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:52

    You are almost right. Basically, Java has no concept of templates (C++ has). This is called generics. And this defines a generic class Class<> with the generics' attribute being any subclass of Something.

    I suggest reading up "What are the differences between “generic” types in C++ and Java?" if you want to get the difference between templates and generics.

提交回复
热议问题