// Program 1 class Wallet { private int money = 0; private int used = 0; public Wallet(int money) { this.money = money; } public void takeMoney(int need) { money -= need; } public void show() { System.out.println("Remain " + money); } public void withdraw(int need) { takeMoney(need); show(); this.used += need; System.out.println("Spent " + this.used); } } public class Main_Program1 { public static void main(String[] args) { Wallet myWallet = new Wallet(100); myWallet.withdraw(40); } }