How to find intersection values of two Arrays

This is the second solution to find the intersection of two Arrays of integers or Strings or Characters. This program has one Generic method which accepts two arrays of any data type (Integers or Strings or Characters). The internal logic is comparing each value of the first array with each of value of the second array. This program uses couple of StringBuilder’s class methods.

public class IntersectionOfArraysGenerics {

	// Generic method to display an array values in some specific format
	private static <T> void dispArray(T[] numArray) {

		String dataType = numArray.getClass().getSimpleName().replace("[]", "s");
		System.out.println("An Array of " + dataType);
		System.out.print("[ ");
		for (int i = 0; i < numArray.length; i++) {
			System.out.print(numArray[i] + " ");
		}
		System.out.println("]");
	}

	// Generic method to find the intersection values in the given two arrays
	public static <T> void findIntersectionValues(T[] arrayFirst, T[] arraySecond) {

		boolean isAvailable = false;
		String dataType = arrayFirst.getClass().getSimpleName().replace("[]", "");
		StringBuilder matchingNums = new StringBuilder("[");
		/*
		 * Check the each value of the first array within the second array. Follow the
		 * Nested loop to traverse comparing values in two arrays
		 */
		for (int i = 0; i < arrayFirst.length; i++)
			for (int j = 0; j < arraySecond.length; j++)
				switch (dataType) {
				case "String":
					if (arrayFirst[i].equals(arraySecond[j])) {
						matchingNums.append(arrayFirst[i] + ", ");
						isAvailable = true;
					}
					break;
				case "Integer":
				case "Character":
					if (arrayFirst[i] == arraySecond[j]) {
						matchingNums.append(arrayFirst[i] + ", ");
						isAvailable = true;
					}
					break;
				}
		dispArray(arrayFirst);
		dispArray(arraySecond);
		if (isAvailable) {
			System.out.println("Intersection " + dataType + "s from the above two arrays are");
			matchingNums.setCharAt(matchingNums.lastIndexOf(String.valueOf(',')), ']');
			System.out.println(matchingNums);
		} else {
			System.out.println("No common " + dataType + "s in the given two arrays, hence output is empty");
			matchingNums.append("]");
			System.out.println(matchingNums);
		}
		System.out.println();
		matchingNums.delete(0, matchingNums.length());
	}

	public static void main(String[] args) {

		// Initialized the two Arrays with some Integers
		Integer[] arrayFirstIntegers = { 5, 2, 9, 12, 1, 4, 73 };
		Integer[] arraySecondIntegers = { 9, 1, 2 };
		/*
		 * Call the Generic method to find intersection of two arrays passed by
		 * reference
		 */
		findIntersectionValues(arrayFirstIntegers, arraySecondIntegers);

		// Initialize the two Arrays to some String values
		String[] arrayFirstStrs = { "Perry", "Nolan", "Amanda", "Rob" };
		String[] arraySecondStrs = { "Nolan", "Rob" };
		findIntersectionValues(arrayFirstStrs, arraySecondStrs);

		// Initialize the two Arrays with some Characters
		Character[] arrayFirstChars = { 'G', 'I', 'L', 'K', 'N', 'A' };
		Character[] arraySecondChars = { 'I', 'N', 'H' };
		findIntersectionValues(arrayFirstChars, arraySecondChars);
	}
}
Output:
An Array of Integers
[ 5 2 9 12 1 4 73 ]
An Array of Integers
[ 9 1 2 ]
Intersection Integers from the above two arrays are
[2, 9, 1] 

An Array of Strings
[ Perry Nolan Amanda Rob ]
An Array of Strings
[ Nolan Rob ]
Intersection Strings from the above two arrays are
[Nolan, Rob] 

An Array of Characters
[ G I L K N A ]
An Array of Characters
[ I N H ]
Intersection Characters from the above two arrays are
[I, N]