String sort() Method


import java.util.*;
import java.io.*;
import java.lang.String;

public class Test_java{
  public static void main(String args[]){
  String string = "I am faizal";
  char[] content = string.toCharArray();
  java.util.Arrays.sort(content);
  String sort = new String(content);
  System.out.println(sort);
  }
}

output

  Iaaafilmz



Post a Comment

Copyright © Rough Record. Designed by OddThemes