jemini_fr posteets tagged tri  [ Profile ]

Sort by: Date / Title /

  1. 6 months ago
    1. ArrayList<Object> list = new ArrayList<Object>();
    2. ...
    3. //tri
    4. Collections.sort(list, new Comparator(){
    5.     public int compare(Object o1, Object o2) {
    6.        return o1.compareTo(o2);
    7.     }
    8. });
    9.  
    10. Ecrire la fonction compareTo() pour l'objet de la liste. Elle doit renvoyer 0 si les 2 objets sont égaux, <0 si o1 < o2 et >0 si o1>o2.

First / Previous / Next / Last / Page 1 of 1 (1 posteets)