Write a Java program to take an string array and find the duplicate and sort in ascending order.
import java.util.*;
class RemoveDuplicateStringArray
{
public static void main(String[] args)
{
String[] s={"z","a","c","a","d","c","b"};
TreeSet<String> ts=new TreeSet<>(Arrays.asList(s));
System.out.println(ts);
}
}
Write a Java program to take an string array and find the duplicate and sort in ascending order. [All Java Interview Programs] |
0 Comment to "Write a Java program to take an string array and find the duplicate and sort in ascending order."
Post a Comment