26. Remove duplicate value from Array - prabhatrocks07/Core-Java-Programming GitHub Wiki

public class RemDupFromArray {

public static void main(String[] args) {
	
	String[] strArr = {"one", "two", "three", "four", "five", "four"};
	//Convert String array to list
	List<String> list = Arrays.asList(strArr);
	//Create a treeset with the list, which eliminates duplicate
	Set<String> unique = new TreeSet<>(list);

	System.out.println(unique);
}
}
⚠️ **GitHub.com Fallback** ⚠️