Collection Of Collections

Hi all,

I am dealing with a search page which is having 8 search fields. i have a way for individual search fields. but i need to have multiple search.. with any to any combination in all the 8 fields. for this I need a List or an ArrayList which can hold Lists aagain.

Eg:

List a = null;

List b = null;

List c = null;

List d = null;

/* I want List d to hold the above 3 lists...

List d ={List a , List B, Listc }*/

it need not be a list only.. any collection which can hold any other collections.

If any one knows it pls reply.

[610 byte] By [lingamaneni] at [2007-9-26 1:17:24]
# 1
No problem, a List (more precisily an ArrayList) can hold a list of any objects including other Lists. Just do: List d = new ArrayList(); d.add(a); d.add(b); d.add(c); --lichu
lichudang at 2007-6-29 0:46:53 > top of Java-index,Core,Core APIs...