java中排序一個字串陣列

weixin_34041003發表於2013-09-13
package test_set_map;


import java.util.Arrays;
import java.util.Collections;


public class Test_Collectins {


	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		String demos[]={"hello","軟體小宇","test","中國"};
		Collections.sort(Arrays.asList(demos));
		for(int i=0;i<demos.length;i++){
			System.out.println(demos[i]);
		}
	}


}



相關文章