A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
meaning of "?" in list
Joined: Oct 06, 2008
Oct 20, 2008 00:06:00
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
Oct 20, 2008 00:41:00
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
could help you understand better.
subject: meaning of "?" in list
Error: Generics are not supported in -source 1.4
S&B 1.5, Chapter 7, Question 2, answer C
what is the use of ..
List interface in Collection Framework
how to add an array to an ArrayList
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014