The Artima Developer Community
Sponsored Link

Java Answers Forum
Ascending order programme

1 reply on 1 page. Most recent reply: Apr 1, 2002 7:30 PM by Charles Daniels

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Kelly Adabla

Posts: 4
Nickname: zaz009
Registered: Mar, 2002

Ascending order programme Posted: Apr 1, 2002 1:24 PM
Reply to this message Reply
Advertisement
Can any one out there please write me a programme that sorts names in alphabetical order. please give a documentation of the approach used to solve the problem


Charles Daniels

Posts: 4
Nickname: repoman
Registered: Apr, 2002

Re: Ascending order programme Posted: Apr 1, 2002 7:30 PM
Reply to this message Reply
Assuming your names are contained within a String array called 'names', the following line will perform a case-sensitive ascending sort:

java.util.Arrays.sort(names);

To perform a case-insensitive ascending sort, use the following line:

java.util.Arrays.sort(names, String.CASE_INSENSITIVE_ORDER);

Flat View: This topic has 1 reply on 1 page
Topic: executing a unix shell command using jsp Previous Topic   Next Topic Topic: Text Marquee to Simulate

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use