Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-16-2008, 11:36 PM
Java Tip's Avatar
Moderator
 
Join Date: Nov 2007
Posts: 1,691
Rep Power: 5
Java Tip will become famous soon enoughJava Tip will become famous soon enough
Default Converting array to list and sorting it
Code:
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class Sort {
  public static void main(String args[]) {
    String[] strArray = new String[] { "Java", "Forums", "And", "and",
        "Tips", "Java-Forums" };

    List l = Arrays.asList(strArray);
    Collections.sort(l);
    System.out.println(l);
  }
}
__________________
"The sole cause of man’s unhappiness is that he does not know how to stay quietly in his room." - Blaise Pascal
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorting an array of Strings Java Tip java.lang 0 04-15-2008 08:39 PM
Converting an Array to a Vector Java Tip java.lang 0 04-14-2008 09:44 PM
Converting a Collection to an Array Java Tip java.lang 0 04-14-2008 09:44 PM
Sorting, Searching, and Inserting into a sorted array Java Tip java.lang 0 04-14-2008 09:39 PM
Converting ArrayList to Array Java Tip Java Tips 0 11-13-2007 11:41 AM


All times are GMT +2. The time now is 11:39 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org