32 lines
601 B
Java
32 lines
601 B
Java
package intro.bank;
|
|
|
|
public class ContoCorrente {
|
|
private int balance;
|
|
private String owner;
|
|
|
|
public ContoCorrente(String owner) {
|
|
this.balance = 0;
|
|
this.owner = owner;
|
|
}
|
|
public ContoCorrente(String owner, Integer balance) {
|
|
this.balance = balance;
|
|
this.owner = owner;
|
|
}
|
|
public int getBalance() {
|
|
return balance;
|
|
}
|
|
|
|
public void setBalance(int balance) {
|
|
this.balance = balance;
|
|
}
|
|
|
|
public String getOwner() {
|
|
return owner;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "ContoCorrente[Owner: "+this.owner+" Balance: "+this.balance+"]";
|
|
}
|
|
}
|