The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
April 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Use java.util.Arrays.sort ( str_array)

Posted by Kishori Sharan on April 29, 2001 at 11:08 AM

You can use sort method of Arrays class. For example,

// Create String array
String[] str = new String[10] ;

// POpulate the array
...

// Sort it
Arrays.sort ( str ) ;

You need to import java.util package to use Arrays class.




Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us