符号是什么意思? [重复]

时间:2022-02-06 16:56:40

This question already has an answer here:

这个问题在这里已有答案:

While doing some android app development, I encounter the parameter AdapterView< ? > test. My question is what exactly does < ? > mean or do because I also see it in many other places such as a Map where it is Map< String ,? >.

在做一些Android应用程序开发时,我遇到参数AdapterView 测试。我的问题究竟是什么? >意思还是因为我也在许多其他地方看到它,比如Map是Map ,?>

1 个解决方案

#1


3  

In generic code, the question mark (?), called the wildcard, represents an unknown type.

在通用代码中,称为通配符的问号(?)表示未知类型。

The wildcard can be used in a variety of situations: as the type of a parameter, field, or local variable; sometimes as a return type.

通配符可用于各种情况:作为参数,字段或局部变量的类型;有时作为回归类型。

So in order to answer the question: it is a Wildcard-> Official Doc so you can handle classes event when you dont know the type.

所以为了回答这个问题:它是一个通配符 - >官方文档,所以当你不知道类型时你可以处理类事件。

#1


3  

In generic code, the question mark (?), called the wildcard, represents an unknown type.

在通用代码中,称为通配符的问号(?)表示未知类型。

The wildcard can be used in a variety of situations: as the type of a parameter, field, or local variable; sometimes as a return type.

通配符可用于各种情况:作为参数,字段或局部变量的类型;有时作为回归类型。

So in order to answer the question: it is a Wildcard-> Official Doc so you can handle classes event when you dont know the type.

所以为了回答这个问题:它是一个通配符 - >官方文档,所以当你不知道类型时你可以处理类事件。