4

In IntelliJ IDEA, especially when I create the instance of Collection class like:

Collection<?> collection = ...;
collection.

And try typing the method add, IntelliJ helps me telling that add's first argument is capture of ? e.

Anyway, I can't use any value as the argument like:

collection.add(new Integer(5));

and the message is

add(capture<?>) in Collection cannot be applied to (java.lang.Integer)

What does it mean?

Lyubomyr Shaydariv
  • 19,389
  • 12
  • 60
  • 100
Beraliv
  • 489
  • 7
  • 18

0 Answers0