Arraylist problem Sort Date , alphabetically
Hello guys,
I've 2 problems.
- the first one, my english is bad (because im dutch;)).
- and the second problem is that I dont know how to sort my arraylist.
Code:
private ArrayList<Persoon> personen;
public PersonenLijstklasse ()
{
}
public void personenLijst(){
personen = new ArrayList<Persoon>();
personen.add(new Student("Karel","Jansen","M","07-04-1990","BI","Piet van Roekel"));
personen.add(new Student("Frank","Bos","M","07-01-1989","CMD","Piet van Roekel"));
personen.add(new Student("Coen","Geluk","M","07-02-1991","TI","Ronald de Boer"));
personen.add(new Leraar("Piet","van Roekel","M","03-01-1970",8,"PVR"));
personen.add(new Leraar("Jaap","de Mol","M","05-05-1969",7,"JDM"));
personen.add(new Leraar("Ronald","de Boer","M","06-06-1975",9,"RDB"));
}
Im trying to create a method that sort the arraylist by date( and a method that sort the array by first name.
how can i do that the best way?
I've tryed a lot, but most of the time I get errors or it does not work as I expected:(
Thanks in advance!!
Greetings, ob3lix