Remove duplicate element of an integer array


Problem:
Remove duplicate element of an integer array.

Solution:

//Remove duplicate element of an integer array
	public void removeDuplicateElements(int[] A){
		// primitive  to Wrapper
		Integer[] integerArr = new Integer[A.length];
		for (int i = 0; i < integerArr.length; i++) {
			integerArr[i] = A[i];
		}
		
		Integer[] integerArr2 = new HashSet<Integer>(Arrays.asList(integerArr)).toArray(new Integer[0]);
		int[] outputArray = new int[integerArr2.length];
		for (int i = 0; i < outputArray.length; i++) {
			outputArray[i] = (int)integerArr2[i];
			System.out.println((int)outputArray[i]);
		}
	}