Hi All,
public static void main(
String[] args) {
List<Integer> listA = new ArrayList<Integer>();
List<Integer> listB = new ArrayList<Integer>();
listA.add(1);
listA.add(2);
listA.add(3);
listA.add(4);
listB.add(1);
listB.add(2);
listA.addAll(listB);
for(Integer ele : listA){
System.out.print(ele);
}
}
Program prints values from both the list (listA and listB) (1,2,3,4,1,2).
or the result should be union of listA and listB ie listA Union listB ie (1,2,3,4)
Please Help.