I am making a program based on string processing in Java in which I need to remove duplicate strings from a string array. In this program, the size of all strings are same.
import java.util.*;
public class Stringarray {
public static void main(String args[]){
String[] name = {"aim","rajesh","raju","aim"};
Set myset = new HashSet();
Collections.addAll(myset,name);
System.out.println(myset);
}
}