public abstract class Instrument { protected String nom; protected String tessiture; protected boolean polyphonique; protected int id; protected boolean lock; public Instrument() { this.nom = "None"; this.tessiture = ""; this.polyphonique = false; this.lock = false; } public Instrument(String nom, String tessiture, boolean phonie, int id) { this.nom = nom; this.tessiture = tessiture; this.polyphonique = phonie; this.id = id; this.lock = false; } // méthode jouer mère public void jouer() { System.out.println("l'instrument produit un son"); } // affiche l'instrument public void afficherInstrument() { System.out.println("L'objet appartient à la classe " + this.getClass().getName()); System.out.println("Id : " + this.id); System.out.println("Nom de l'instrument : " + this.nom); System.out.println("Tessiture : " + this.tessiture); if (this.polyphonique) System.out.println("L'instrument est polyphonique"); else System.out.println("L'instrument n'est pas polyphonique"); } }