首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

把字符串从小到大输出(自个儿测试用的)

2012-11-03 
把字符串从小到大输出(自己测试用的)public class TestString {?public static void main(String[] args){

把字符串从小到大输出(自己测试用的)

public class TestString {
?public static void main(String[] args){
??String s="123427";
??
??List list=new ArrayList();
??
??for(int i=0;i<s.length();i++){
????????? list.add(s.charAt(i));
??}
??Collections.sort(list);
??
??for(int j=0;j<list.size();j++){
???System.out.print(list.get(j)+" ");
??}
?}
}

热点排行