10 April 2012

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



0 comments:

Post a Comment

Related Posts with Thumbnails

Popular Posts

 
;