import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
public class ConvertArrayList2Set {
/**
* Conversion from a List to a Set,
* or from an ArrayList to a HashSet object
*/
public static void main(String[] args) {
List<Object> list= new ArrayList<Object>();
list.add("JavaStuff");
list.add(new Long(15));
list.add(new Integer(6));
list.add(new Date());
Set<Object> set = new HashSet<Object>(list);
for (Object obj : set)
System.out.println(obj);
}
}