Skip to content

Instantly share code, notes, and snippets.

@ejknapp
Created February 16, 2011 20:56
Show Gist options
  • Save ejknapp/830183 to your computer and use it in GitHub Desktop.
Save ejknapp/830183 to your computer and use it in GitHub Desktop.
package java112.labs2;
import java.util.*;
/**
* @author Eric Knapp
* class SetList
*
*/
public class SetList {
public void run() {
List list = new ArrayList();
list.add("one");
list.add("one");
list.add("two");
list.add("two");
list.add("three");
list.add("four");
list.add("four");
System.out.println(list);
Set set = new TreeSet(list);
System.out.println(set);
}
public static void main(String[] args) {
SetList demo = new SetList();
demo.run();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment