1

I'm taking here about Iterators, Lists, etc.. , when trying to declare it without assigning parameters:

List mylist;
Iterator mykey;

I got the warning:

List is a raw type. References to generic type List<E> should be parameterized

but when change it to:

List <?> mylist;
Iterator <?> mykey;

the warning disappears like if I solve the problem which didn't happen as I'm didn't assign a Solid Parameter to it. So, what makes the Compiler ignores the warning when giving it that generic parameter? and why Java don't consider that not giving it a parameter is like giving it a generic parameter as in both cases I can completing the initialization process with the same RHS.

Muhammed Refaat
  • 8,914
  • 14
  • 83
  • 118
  • 1
    ? means a `List` or rather `Type` of *unknowns*, check this out too: [What is List>](http://stackoverflow.com/questions/8664932/what-is-list-in-java-android) – Austin Jun 18 '14 at 13:24
  • 1
    See this: [What is the difference between the unbounded wildcard parameterized type and the raw type?](http://www.angelikalanger.com/GenericsFAQ/FAQSections/ParameterizedTypes.html#FAQ303) – Jesper Jun 18 '14 at 13:25
  • 3
    See http://stackoverflow.com/questions/1844770/what-does-list-mean-in-java-generics – vikingsteve Jun 18 '14 at 13:26
  • I understand that there's may be some duplicates but I tried to search before and got nothing as I didn't know that it's type name in `wildcard` – Muhammed Refaat Jun 18 '14 at 13:33
  • thanks for all these useful links – Muhammed Refaat Jun 18 '14 at 13:34

0 Answers0