返回按字母顺序排序的向量副本。
//package com.nowjava; import java.util.Collections;/** 来 自 n o w j a v a . c o m**/ import java.util.Comparator; import java.util.List; public class Main { public static void main(String[] argv) { List list = java.util.Arrays.asList("asdf", "nowjava.com"); sortListAlphabetically(list); } /** Returns an alphabetically sorted copy of vector. */ public static void sortListAlphabetically(List list) { Collections.sort(list, new Comparator() { public int compare(Object a, Object b) { String textA = a.t