What does Class mean? in Java?

Question:

I haven't found an example with <?> Why not just use class as parameter?

Answer:

You can often see something like Class<String> indicating that String is the class type modeled by the Class object.

Based on your question, you can use < ? > if the class being modeled is unknown: Class<?>

https://docs.oracle.com/javase/7/docs/api/java/lang/Class.html

Scroll to Top