Example

import java.io.*;
import java.util.List;
import java.util.Arrays;// to use arrays
import java.util.*;// Arrays.sort
public class Test_This {
public static void main(String[] args) throws IOException{
// TODO Auto-generated method stub
Process p1 = new Process();
p1.method_1();
}
}
class Process
{
String first[] = {"Java","A+","C#","XML","JSP","PHP","Z", "C#"};
//to be used with set add all change other wise
String[] second = {"0.0","0.1","0.2","0.3","0.2","0.4"};
public Process()
{
System.out.println("Default) constructor");
}
public void method_1()
{
List list = Arrays.asList(first);
Set set = new HashSet(Arrays.asList(first));
set.addAll(Arrays.asList(second));
System.out.println(set);
System.out.println("--remove all--");
set.removeAll(Arrays.asList(second));
System.out.println("remove inserted set : " +set);
set.removeAll(Arrays.asList(first));
System.out.println("remove original set : " +set);
}
}