Compare commits

...

2 Commits

Author SHA1 Message Date
ines.benalia
aeffca7bcc création des méthodes get/set/toString de la classe Instrument 2024-09-12 09:06:59 +02:00
ines.benalia
6fc99cba67 création des variables membres de la classe Instrument 2024-09-12 08:56:15 +02:00

View File

@ -10,4 +10,54 @@ package métiers;
*/
public class Instrument {
private int ref;
private String designation;
private int qteStock;
private float prix;
public Instrument(int ref, String designation, int qteStock, float prix){
this.ref=ref;
this.designation=designation;
this.qteStock=qteStock;
this.prix=prix;
}
@Override
public String toString() {
return "Instrument{" + "ref=" + ref + ", designation=" + designation + ", qteStock=" + qteStock + ", prix=" + prix + '}';
}
public void setRef(int ref) {
this.ref = ref;
}
public void setDesignation(String designation) {
this.designation = designation;
}
public void setQteStock(int qteStock) {
this.qteStock = qteStock;
}
public void setPrix(float prix) {
this.prix = prix;
}
public int getRef() {
return ref;
}
public String getDesignation() {
return designation;
}
public int getQteStock() {
return qteStock;
}
public float getPrix() {
return prix;
}
}