public class CompteEpargne extends Compte { private double interet; public double getInteret(){ return this.interet; } public void setInteret(double x){ this.interet = x; } public double interets(){ return (getCredit()-getDebit())*getInteret(); // return (soldeCredit()-soldeDebit())*getInteret(); } public void echeance(){ crediter(interets()); } public void debiter(double val){ if((getCredit()-val)>0){ setDebit(getDebit()+val); } } public CompteEpargne(double creditInit, double interet){ super(creditInit); setInteret(interet); } public CompteEpargne(){ super(); setInteret(0.1); } public String etat(){ return super.toString()+" Interets du mois: "+ interets(); } }