| Author |
arraylist
|
vijayapriya thirumurugan
Greenhorn
Joined: Apr 03, 2009
Posts: 16
|
|
hello sir,
i used object[][] el=new object[10][10]; to store arraylist in the form of matrix. and i got the output
[1, 3] null null null null
null [1, 2] null null null
null null [2] null null
null null null [] null
null null null null [1, 3]
my problem is :
[1,3] is in the position el[1][1] , [1,2] is in the position el[2][2]. where [1,3] is arraylist [1,2] , [2] ,[], [1,3] are also arraylist.
i want to get the common element between [1,3] and [1,2] i.e. the answer will be [1]. like this i want to get common elements which is of arraylist format.
can you help me. i'm waiting..
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32708
|
|
|
Don't understand the question, I am afraid.
|
 |
vijayapriya thirumurugan
Greenhorn
Joined: Apr 03, 2009
Posts: 16
|
|
i got the about output.. i want to get common element between two arraylist
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32708
|
|
You can't return a "common element" because there might not be one common element. You can however search for a set of common elements.
I would convert the two Lists to Sets, then use the "bulk" methods of the Set interface. Look here and here.
|
 |
 |
|
|
subject: arraylist
|
|
|