CollectionSort.java
package java8s;
import java.util.*;
public class CollectionSort {
public
static void main(String... args)
{
List
l = new ArrayList();
l.add("Bhubaneswar");
l.add("Cuttack");
l.add("Paradeep");
l.add("Jagatsinghpur");
l.add("Kujanga");
Collections.sort(l);
System.out.println("Location :
"+l);
}
}
|
Output
Location : [Bhubaneswar, Cuttack,
Jagatsinghpur, Kujanga, Paradeep]