import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
public class test {
public static void main(String[] args) {
List<Integer> list = new ArrayList<Integer>(4);
list.add(9);
list.add(2);
list.add(1);
list.add(1);
list.add(3);
System.out.println(list.toString());
Set set = new HashSet();
set.addAll(list);
Iterator it = set.iterator();
while(it.hasNext()){
System.out.println(it.next());
}
}
}
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
public class test {
public static void main(String[] args) {
List<Integer> list = new ArrayList<Integer>(4);
list.add(9);
list.add(2);
list.add(1);
list.add(1);
list.add(3);
System.out.println(list.toString());
Set set = new HashSet();
set.addAll(list);
Iterator it = set.iterator();
while(it.hasNext()){
System.out.println(it.next());
}
}
}