Tuesday, August 31, 2010

Article | Java sort() Method Example

The sort() method sort words in ascending order


  1. import java.util.*;

  2. import java.io.*;

  3. import java.lang.String;

  4. public class sortstr{

  5. public static void main(String args[]){

  6. String str = "Java String Example";

  7. char[] content = str.toCharArray();

  8. java.util.Arrays.sort(content);

  9. String sorted = new String(content);

  10. System.out.println(content);

  11. }

  12. }

Loading...

Comments :

0 comments to “ Java sort() Method Example ”

Top Views

BloggerTipsTemplates

CHICKLETS

Enter your email address:

Delivered by FeedBurner

Followers