samples/individualsamples/src/org/apidesign/samples/SortNames.java
author Jaroslav Tulach <jtulach@netbeans.org>
Wed, 26 Oct 2011 21:45:23 +0200
changeset 383 40a073776e5b
child 401 a9097bdcf307
permissions -rw-r--r--
Showing the sort example in a real project
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@383
    10
        List<String> arr = new ArrayList<String>();
jtulach@383
    11
        arr.add("Tom");
jtulach@383
    12
        arr.add("Petr");
jtulach@383
    13
        Collections.sort(arr);
jtulach@383
    14
        // END: petr.tom.sort
jtulach@383
    15
        
jtulach@383
    16
        System.err.println("Names: " + arr);
jtulach@383
    17
    }
jtulach@383
    18
}