Java - Write code to sort characters in a string

Requirements

Write code to sort characters in a string

Demo

//package com.book2s;
import java.util.Arrays;

public class Main {
    public static void main(String[] argv) {
        String string = "book2s.com";
        System.out.println(sort(string));
    }/*from  ww w  . j  av  a 2 s .  c o  m*/

    public static String sort(String string) {
        char[] characters = string.toCharArray();
        Arrays.sort(characters);
        return String.valueOf(characters);
    }
}