File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Head First Android
this week in the
Programmer Certification (SCJP/OCPJP)
List interface in Collection Framework
Ajay Singh Rathore
Joined: Nov 20, 2007
Sep 27, 2008 11:48:00
can anyone explain this syntax.
List<List<Integer>> table = new
what is the meaning of this syntax.
Joined: Jun 03, 2008
Sep 27, 2008 12:02:00
up to my knowledge that is list of integer lists.
tables list contains lists of integers
thanks and regards<br />Santhi Bharath<br />SCJP 5.0, SCWCD 5.0
Joined: Aug 03, 2008
Sep 27, 2008 23:43:00
Hi Ajayr! Welcome to Javaranch.
Santhi is right. your reference variable table is a list of integer lists.
Lets take a more meaningful example to understand this-
List<List<Planet>> solarSystems = new List<List<Planet>>();
so here we have a list of solar systems, where each solar system has a list of planets. You can add elements to this list as follows
List<Planet> sun = new List<Planet>();
List <Planet> dogStar = new List<Planet>();
SCJP 6 | SCWCD 5 |
Javaranch SCJP FAQ
Joined: Sep 13, 2008
Sep 28, 2008 02:32:00
More than the theoretical explanation, the code looks more understanding...Thanks Ankit !!!
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
subject: List interface in Collection Framework
How do I read this?
Help me with this simple code
Why is List<? super Number> a subtype of List<? super Integer> ?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015