Reputation: 263
I 'm going through a code and found the following method declaration.
public void onItemClick(AdapterView<?> parent, View v, int position, long id)
What does <?>
mean here?
Thank you.
Upvotes: 4
Views: 403
Reputation: 81684
AdapterView
is a generic class. It takes another data type as a parameter, and its operation is then customized towards that type, in a way. Normally, you'll declare an AdapterView
something like
AdapterView<String> avs = new AdapterView<String>(...);
This refers to an AdapterView
customized for String
s.
Now, given all that: the <?>
means that this method will accept an AdapterView
regardless of the class it's customized for. It's a wildcard type specifier.
Upvotes: 6