Created
February 16, 2011 20:56
-
-
Save ejknapp/830182 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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