public class METHOD_CDM {
public static void main(String[] args) {
int[] arr1 = {4, 8, 3, 5, 10, 11};
int[] arr2 = {3, 4, 5, 8, 6, 9, 12};
System.out.println("intersection of given two array");
for (int i = 0; i < arr1.length; i++) {
for (int j = 0; j < arr2.length; j++) {
if (arr1[i] == arr2[j]) {
System.out.println(arr1[i] + "");
}
}
}
}
}
//output
intersection of given two array 4 8 3 5 Process finished with exit code 0


0 Comments