Friday, March 23, 2018

Write a Java program to take an string array and find the duplicate and sort in ascending order.


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.
Write a Java program to take an string array and find the duplicate and sort in ascending order. [All Java Interview Programs]


Share this

0 Comment to "Write a Java program to take an string array and find the duplicate and sort in ascending order."

Post a Comment