
Faculté des sciences de Bizerte
Université de Carthage A.U : 2020/2021
__________________________________________________________________________________________
System.out.println("Solde insuffisant !");
}
}
public int getNumeroCompte(){
return this.numeroCompte;
}
public float getSolde(){
return this.solde;
}
public void afficherInformationCompte() {
System.out.println("Le compte numéro: "+this.numeroCompte+ " possède le solde=
"+this.solde);
}
}
public class TestCompte{
public static void main (String[] args){
CompteBancaire cpt1= new CompteBancaire(2000);
CompteBancaire cpt2= new CompteBancaire(1000);
cpt1.afficherInformationCompte();
cpt2.afficherInformationCompte();
cpt1.deposerArgent(1000);
cpt2.retirerArgent(500);