Results 1 to 2 of 2
  1. #1
    ob3lix is offline Member
    Join Date
    Nov 2010
    Posts
    1
    Rep Power
    0

    Exclamation 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.
    Java 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

  2. #2
    eRaaaa is offline Senior Member
    Join Date
    Oct 2010
    Location
    Germany
    Posts
    787
    Rep Power
    11

Similar Threads

  1. adding date in arraylist
    By katturv in forum New To Java
    Replies: 1
    Last Post: 10-23-2010, 06:23 PM
  2. ArrayList sort
    By Dipke in forum New To Java
    Replies: 1
    Last Post: 08-23-2010, 01:01 PM
  3. how to sort an arraylist?
    By zhangster in forum New To Java
    Replies: 5
    Last Post: 03-19-2010, 08:01 AM
  4. Using Merge Sort to sort an ArrayList of Strings
    By coldfire in forum New To Java
    Replies: 3
    Last Post: 03-13-2009, 01:03 AM
  5. Largest string value (alphabetically)
    By mew in forum New To Java
    Replies: 3
    Last Post: 12-14-2007, 05:45 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •