i want to print out an element of an array only once even if the element has many duplicates. her is the code i have tried;-

Code:
     for(int count=0;count<arr.length;count++){
	int counter = 0;
	char num = arr[count];
      for(int count2=0;count2<arr.length;count2++){
	 if(num==arr[count2]){
	   counter++; }
	} System.out.println(num + "\t" + counter);}