my dog learned polymorphism
The moose likes Beginning Java and the fly likes array of array doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Reply 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: 122

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: 1225
    
    3
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.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: array of array doubt
 
Similar Threads
data structure of choice.
UrlyBird : ArrayList problem
Array problem.
Batches of array in an ArrayList
Multidimensional ArrayList