as we know List <Integer> list= new ArrayList<Integer>(); can contain only a list of Integers.
then what is the meaning and use of List <?> list= new ArrayList<Integer>(); what is the use of "?" symbol in this?
Joined: Dec 16, 2007
It means a list of <<Anything>>. It is called as a wild card. The super class to all Generic collections is not Collection<Object> but a Collection<?>.May be this link could help you understand better.