public class Main { public static void main(String[] args) {
List<String> myList = new ArrayList<String>();
myList.add("A");
myList.add("B");
myList.add("C");
myList.add("D");
Set<String> mySet = new HashSet<String>(myList);
for (Object theFruit : mySet)
System.out.println(theFruit);
}
}
/*
D
A
B
C
*/