Sorting in an array Object

I am new to java program. I would like to know how to do the sorting in an array object.

I have four fields [ Author, Date, BookTitle, Status, ] for storing the data. I would like to

sort as follows:

Author [ascending order]

Date[descending order]

BookTitle [ascending order]

Can anyone show me the example how to do that?

Thanks

MyDreamCar

The case as below:

Before Sorting , the array as follows:

String array [][] = {{"Ann", "2002-09-23", "Introdction to C Programming", "Available"},

{"Ann", "2001-11-30", "Introdction to Java Programming", "Available"},

{"Tom", "2004-09-08", "Introdction to Perl Programming", "Not Available"},

{"John", "2001-08-29", "Introdction to Visual Basic Programming", "Available"},

{"Ann", "2000-09-09", "ASP Programming", "Not Available"},

{"Tom", "2004-09-10", "Networking Programming", "Not Available"},

{"John", "2004-08-18", "C How to program", "Available"},

{"Howard", "2003-10-10", "Core Java Programming", "Available"},

{"Ann", "2002-09-23", "Pascal Programming", "Available"},

{"Billy", "2000-12-22", "Advanced C Programming ", "Not Available"}

};

Expected Sorting result as follows:

{"Ann", "2002-09-23", "Introdction to C Programming", "Available"},

{"Ann", "2002-09-23", "Pascal Programming", "Available"},

{"Ann", "2001-11-30", "Introdction to Java Programming", "Available"},

{"Ann", "2000-09-09", "ASP Programming", "Not Available"},

{"Billy", "2000-12-22", "Advanced C Programming ", "Not Available"}

{"Howard", "2003-10-10", "Core Java Programming", "Available"},

{"John", "2004-08-18", "C How to program", "Available"},

{"John", "2001-08-29", "Introdction to Visual Basic Programming", "Available"},

{"Tom", "2004-09-10", "Networking Programming", "Not Available"},

{"Tom", "2004-09-08", "Introdction to Perl Programming", "Not Available"},

[1991 byte] By [mydreamcar] at [2007-9-30 20:36:13]
# 1

Most of what you need is already written in the Java Collections Framework.

http://java.sun.com/j2se/1.5.0/docs/guide/collections/index.html

You need to write a compare function that implements

the natural ordering you want.

http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Comparable.html

Then the Collections methods can do their work and provide

you with a sorted list.

http://java.sun.com/j2se/1.5.0/docs/api/java/util/Collections.html#sort(java.util.List)

debugging_team at 2007-7-7 1:25:35 > top of Java-index,Administration Tools,Sun Connection...
# 2
You Can use:The java.util.Arrays class contains various methods for sorting and searching. In particular, static void sort(Object[] a) static void sort(Object[] a, Comparator c)But for Null reference and non camparable values it throws Null Pointers Exception.
Rajiv_Mishra at 2007-7-7 1:25:35 > top of Java-index,Administration Tools,Sun Connection...