samples/individualsamples/src/org/apidesign/samples/SortNames.java
author Jaroslav Tulach <jtulach@netbeans.org>
Mon, 13 Aug 2012 10:52:45 +0200
changeset 401 a9097bdcf307
parent 383 40a073776e5b
permissions -rw-r--r--
Using more descriptive name than arr per Petr Hejl's request
jtulach@383
     1
package org.apidesign.samples;
jtulach@383
     2
jtulach@383
     3
import java.util.ArrayList;
jtulach@383
     4
import java.util.Collections;
jtulach@383
     5
import java.util.List;
jtulach@383
     6
jtulach@383
     7
public class SortNames {
jtulach@383
     8
    public static void main(String... args) {
jtulach@383
     9
        // BEGIN: petr.tom.sort
jtulach@401
    10
        List<String> names = new ArrayList<String>();
jtulach@401
    11
        names.add("Tom");
jtulach@401
    12
        names.add("Petr");
jtulach@401
    13
        Collections.sort(names);
jtulach@383
    14
        // END: petr.tom.sort
jtulach@383
    15
        
jtulach@401
    16
        System.err.println("Names: " + names);
jtulach@383
    17
    }
jtulach@383
    18
}