I have two arrays
String[] ID1={"19","20","12","13","14"};
String[] ID2={"10","11","12","13","15"};
How can I get following answer while comparing above two arrays.
I want to exclude common elements while comparing above two arrays.
String[] Result={"14","15","19","20","10","11"};
Seems like you want the union of the two sets (no duplicates, right?) minus the intersection:
(I changed your String to Integer, which seems to fit the data better, but it would work with String the same way)