Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Conto {
- private double amount;
- private String owner;
- // costruttore
- public Conto(String owner, double initialAmount) {
- this.owner = owner;
- this.amount = initialAmount;
- }
- public void versamento(double qty) {
- amount += qty;
- }
- public boolean prelievo(double qty) {
- if(amount < qty)
- return false;
- amount -= qty;
- return true;
- }
- public double getAmount() {
- return amount;
- }
- public String getOwner() {
- return owner;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment