Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java is list ordered

TreeSet<String> set = new TreeSet<String>();
set.add("lol");
set.add("cat");
// automatically sorts natural order when adding

for (String s : set) {
    System.out.println(s);
}
// Prints out "cat" and "lol"
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #java #list #ordered
ADD COMMENT
Topic
Name
1+7 =