I have to write a program that counts the uniques characters in a String given by the user. For example \"abc\" returns 3 and \"aabbccd\" returns 4. I am not allow to use advan
You can use HashSet collections for counting the unique elements in a string. It allow only unique element.
Code Snippet
public static int uniqueCount(String str) { HashSet al = new HashSet(); char[] arr= str.toCharArray(); for (int i=0; i
Refer this link to get full code: ideone