Skip to content

Instantly share code, notes, and snippets.

@AkhileshKumar01
Created April 5, 2017 02:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AkhileshKumar01/d9087abbd467f94ff4c0c636303620d2 to your computer and use it in GitHub Desktop.
Save AkhileshKumar01/d9087abbd467f94ff4c0c636303620d2 to your computer and use it in GitHub Desktop.
package basicProgram;
import java.util.HashSet;
public class UniqueCharacterTest {
public static void main(String[] args) {
// TODO Auto-generated method stub
String str = "Programming";
HashSet<Character> set1= new HashSet<Character>();
char [] arr= str.toCharArray();
for (char ch : arr) {
set1.add(ch);
}
System.out.println(set1);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment