*
The moose likes Beginning Java and the fly likes array of array doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "array of array doubt" Watch "array of array doubt" New topic
Author

array of array doubt

akila sekaran
Ranch Hand

Joined: Jun 12, 2012
Posts: 48


Whats wrong in this ?
How do i add values to list of list of strings??
Joel Christophel
Ranch Hand

Joined: Apr 20, 2011
Posts: 231
    
    1

List<IBean> list = listB.get(j)

How can 'list', which is a List, be equal to the value of a list index?
akila sekaran
Ranch Hand

Joined: Jun 12, 2012
Posts: 48
Joel Christophel wrote:List<IBean> list = listB.get(j)

How can 'list', which is a List, be equal to the value of a list index?


ListB is a List<List<IBean>>
Tony Docherty
Bartender

Joined: Aug 07, 2007
Posts: 2158
    
  47
How do i add values to list of list of strings??

You get a reference to the list of strings from the list of list of strings (eg by calling it's get() method) and then call it's add() method passing in the String you want to add.
Do you have a list of list of strings in the code shown?

BTW line 6 is overly complicated by you trying to do way too much on one line. I suggest you break into at least 3 lines, it will make your code easier to read and less prone to bugs.
 
wood burning stoves
 
subject: array of array doubt
 
Similar Threads
UrlyBird : ArrayList problem
Array problem.
data structure of choice.
Batches of array in an ArrayList
Multidimensional ArrayList