You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
541 B
Java
27 lines
541 B
Java
public class Position {
|
|
private double solde;
|
|
private Date derniereOperation;
|
|
public Position(double solde) {
|
|
this.solde = solde;
|
|
this.derniereOperation = new Date();
|
|
}
|
|
|
|
public void ajouter(double solde) {
|
|
this.solde += solde;
|
|
this.derniereOperation = new Date();
|
|
}
|
|
|
|
public void retirer(double solde) {
|
|
this.solde -= solde;
|
|
this.derniereOperation = new Date();
|
|
}
|
|
|
|
public String afficher() throws RemoteException {
|
|
return "Solde : " + solde + " ; date de dernière opération : " + derniereOperation;
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|