String[] str={"a","b","c","a"};List list = Arrays.asList(str);Set set = new HashSet(list);str=(String [])set.toArray(new String[0]);