Question

I know this is a very basic question, but I haven't been able to find a way to word it to find the answer either here or through Google.

In the following code:

    public void onItemClick(AdapterView<?> parent, View view, int position, long id)

What does the <'?> mean for the adapter view class template? My guess is that it means the parameter can be an AdapterView holding any type, but I'm not sure and figured I'd ask the community.

Thanks

Était-ce utile?

La solution

You are correct. The parent parameter can be an AdapterView that is an AdapterView for any other object type.

If you want to learn more, check out info on Generics.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top