Example:
list1 : apple,mango,grapes
list2: orange,gauva,cherry
I want the out to be :
apple,orange
mango,gauva
grapes,cherry.
And should be able to display the above output in the form of link on jsp.Please help me out for this .
Example:
list1 : apple,mango,grapes
list2: orange,gauva,cherry
I want the out to be :
apple,orange
mango,gauva
grapes,cherry.
And should be able to display the above output in the form of link on jsp.Please help me out for this .
there are many approaches to do this:
here is one:
final List<String> l1 = new ArrayList<String>();
final List<String> l2 = new ArrayList<String>();
l1.add("mango");
l1.add("apple");
l1.add("grappes");
l2.add("orange");
l2.add("guava");
l2.add("cherry");
for (int i = 0; i < l1.size(); i++) {
System.out.println(l1.get(i) + "," + l2.get(i));
}
this will print:
mango,orange
apple,guava
grappes,cherry