Thank you all.
few things are there in my arraylit object.
Array list is defined in some object say (objDepartmentDetails).
and that Arraylist (say alDept) contains Department objects.The Department object has the fields DeptNo and DeptDate.The getter method for DeptNo is getDeptNum and for the DeptDate is getDeptDate.
and i calling this object(objDepartmentDetails) from other class.
I tried few things.
1. I converted date to Milisecond and then used this
min_time = Array[0].getMillisecond ;max_time =Array[0].getMillisecond;
for (int i = 0; i < Array.length; i++)
{
if (Array[i].getMillisecond < min_score)
{
min_time = Array[i].getMillisecond;
}
else {
if (Array[i].getMillisecond > max_score)
{
max_time = Array[i].getMillisecond; }
but i want to use if any already defined method is available 'cos i have to use the similar logic for 4-5 methods so,
2. I thought of using Collections.sort(); but its not accepting my Arraylist.
2. Then i tried with
getSortedList(ArrayList alObject, String getMethod,String dataType,char order)
but its not recognising the getDeptDate().
i am now clueless.Could you correct me and help in giving me right direction?
Regards.