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
  • 20,327
  • 12
  • 64
  • 105
Beraliv
  • 518
  • 7
  • 20

0 Answers0