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.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
AdapterViewis 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 anAdapterViewsomething likeThis refers to an
AdapterViewcustomized forStrings.Now, given all that: the
<?>means that this method will accept anAdapterViewregardless of the class it’s customized for. It’s a wildcard type specifier.