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"},

