What does Map<?, ?> mean in Java?
I’ve looked online but can’t seem to find any articles on it.
edit : I found this on MP3 Duration Java
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.
?indicates a placeholder in whose value you are not interested in (a wildcard):And since
?is a wildcard, you can skip it and still get the same result:But they can be used to specify or subset the generics to be used. In this example, the first generic must implement the Serializable interface.
But it’s always better to use concrete classes instead of these wildcards. You should only use
?if you know what your are doing 🙂