Opzione 2
This commit is contained in:
@@ -43,6 +43,10 @@ public class ContoCorrente {
|
||||
return numeroContoCorrente;
|
||||
}
|
||||
|
||||
public void versa(double quantita){
|
||||
this.saldo += quantita;
|
||||
}
|
||||
|
||||
public void preleva(double quantita) throws IllegalArgumentException{
|
||||
if (quantita >= this.saldo) {
|
||||
throw new IllegalArgumentException("La quantità desiderata eccede il saldo corrente.");
|
||||
|
||||
Reference in New Issue
Block a user