Search code examples
javaraw-types

What does <?> stand for in Java?


Possible Duplicate:
Java Generics

In Eclipse, I am given warnings for using 'rawtypes' and one of it's fixes is to add <?>. For example:

    Class parameter = String.class;
    //Eclipse would suggest a fix by converting to the following:
    Class<?> parameter = String.class;

What does this <?> actually mean?


Solution

  • Raw types refer to using a generic type without specifying a type parameter. For example, List is a raw type, while List<String> is a parameterized type

    See this document for more info: http://www.javapractices.com/topic/TopicAction.do?Id=224