Java - Classes and Objects
Consider the class below:
class Wallet {
private int money = 0;
public void addMoney(int amount) {
if (amount > 0) {
money += amount;
}
}
public int getMoney() {
return money;
}
}Which statement about the methods is correct?