java基础面试题之String字符串冒泡排序

package com.tarena.fly;

import java.lang.reflect.Array;
import java.util.Arrays;

/**
 * \* Created with IntelliJ IDEA.
 * \* User: 武健
 * \* Date: 2018/1/29
 * \* Time: 20:45
 * \* To change this template use File | Settings | File Templates.
 * \* Description:String 字符串 冒泡排序
 * \
 */
public class Main {
    public static void main(String[] args) {
        String a = "ajfklasjflkawjeiouwoignasgnaaaa";
        char[] chars = a.toCharArray();
        Arrays.sort(chars);
        String result = new String(chars);
        System.out.println(result);
    }
}

你可能感兴趣的:(面试)