1public static void main(String[] args) {
2 Main main = new Main();
3 char[] array = {'e','a','b','a','c','d','b','d','c','e'};
4 main.getCharArray(array);
5}
6
7private char[] getCharArray(char[] array) {
8 String _array = "";
9 for(int i = 0; i < array.length; i++) {
10 if(_array.indexOf(array[i]) == -1) // check if a char already exist, if not exist then return -1
11 _array = _array+array[i]; // add new char
12 }
13 return _array.toCharArray();
14}
15