2021-09-20 13:52:48 +02:00
|
|
|
public class Etudiant {
|
2021-09-20 13:46:56 +02:00
|
|
|
// attributs
|
|
|
|
private boolean apprenti;
|
|
|
|
private String nom;
|
|
|
|
public String promo;
|
|
|
|
|
|
|
|
// constructeur
|
|
|
|
public Etudiant() {
|
|
|
|
this.apprenti = false;
|
|
|
|
}
|
|
|
|
public Etudiant(String nom, boolean app) {
|
|
|
|
this.apprenti = app;
|
|
|
|
this.nom = nom;
|
|
|
|
}
|
|
|
|
|
|
|
|
// méthodes
|
|
|
|
public void setNom(String nom) {
|
|
|
|
this.nom = nom;
|
|
|
|
}
|
|
|
|
public boolean getApprenti() {
|
|
|
|
return this.apprenti;
|
|
|
|
}
|
|
|
|
public String getNom() {
|
|
|
|
return this.nom;
|
|
|
|
}
|
|
|
|
public String getPromo() {
|
|
|
|
return this.promo;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void test(String[] ab) {
|
|
|
|
Etudiant e1 = new Etudiant("Dupond", true);
|
|
|
|
|
|
|
|
e1.nom = "Efrei"; // possible car dans la classe
|
|
|
|
}
|
|
|
|
}
|