Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> Java >> Snippet

Sort an array


import java.util.# ;

String names[] = { "Mike" , "Gary" , "John" }

//imported class Arrays has a sort method (ascending order only)

Arrays.sort(names) ;