JunkJumper 91677806cf Revert "renommage package tree"
This reverts commit ab956d17fc461e31d20fdb32e6029d403d75dc06.
2020-05-20 17:10:40 +02:00

41 lines
702 B
Java

package comparable;
import java.util.*;
public class main {
public static void main(String[] args) {
Personne bart = new Etudiant("Bart", 15, "2nde");
Personne tom = new Etudiant("Tom", 13, "4eme");
Personne max = new Etudiant("Max", 18, "Terminale");
Personne thibault = new Enseignant("Tibault", 41, "Mathematiques");
List <Personne> w = new ArrayList<Personne>();
w.add(bart);
w.add(tom);
w.add(max);
w.add(thibault);
for (Personne p : w){
System.out.println(p.toString());
}
Collections.sort(w);
System.out.println("===================");
for (Personne p : w){
System.out.println(p.toString());
}
System.out.println("Hello World !");
}
}