please, help me with sort object with date and name?
Please, i am new for here, and need much your help. Because i need sort a arraylist with object. my object has a date and a name, i need know how make to compare two dates in comparator for sort it.
private String Name=null;
private Date date = null;
somebody can help me, please
use Comparator or goto techfaq360.com/java_interview_questions.jsp?qid=379 for code example
Last edited by satyadas; 06-06-2008 at 08:37 AM.
make the class implement the Comparable interface and create a way in which you are going to order the objects of the class. By name and then break ties by some dateorder? I expect you would want to use the built-in sorting capabilities of objects of the String and Date abstract data types.
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center