Re: Sort Method Conversion
- From: Roedy Green <see_website@xxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 28 Jun 2007 12:20:17 GMT
On Wed, 27 Jun 2007 17:07:36 -0700, kaltizer <kevinaltizer@xxxxxxxxx>
wrote, quoted or indirectly quoted someone who said :
I need to modify this method to sort an array of strings rather than
chars:
To write general purpose sorts you need the Comparable or Comparator
interface. You implement the interface to do the compare, and your
sort uses only the methods of those interfaces to do the comparing.
See http://mindprod.com/jgloss/sort.html
http://mindprod.com/jgloss/comparable.html (to define the natural
order)
http://mindprod.com/jgloss/comparator.html(to define alternate orders)
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
.
- References:
- Sort Method Conversion
- From: kaltizer
- Sort Method Conversion
- Prev by Date: Re: Help with XML processing using DOM
- Next by Date: Re: double with precision
- Previous by thread: Re: Sort Method Conversion
- Next by thread: Help with XML processing using DOM
- Index(es):
Relevant Pages
|