Given these two arrays as an example:
String[] arr1 = new String[] {"A", "B", "C", "D", "E"};
String[] arr2 = new String[] {"A", "C", "D"};
Well, using only arrays, I would do something like this:
First, make a method to see if an array contains some value:
public boolean aContainsB(String[] a, String b) {
for (String s : a) if (s.equals(b)) return true;
return false;
}
Then, create a new array that is as large as the largest one. It will hold the values that are not in the array. It can potentially be every letter, I am assuming.
String[] notFound = new String[Math.max(arr1.length, arr2.length)];
Then, loop through the first array, and if the current value is not in the second array, append it to the not found array.
int i = 0;
for (String s : arr1) if (!aContainsB(arr2, s)) notFound[i++] = s;
At the end of this, i will contain how many values are not present in the second array, and you can loop through the notFound array i times to print it out.
System.out.println("There are " + i + " elements in arr1 that are not in arr2, they are:");
for (int j = 0; j < i; j++) {
System.out.println("The String: " + notFound[j]);
}
The output will be:
There are 2 elements in arr1 that are not in arr2, they are:
The String: B
The String: E