public class InsufficientFundsException extends Exception { private double balance; public InsufficientFundsException(double balance) { super("余额不足,当前余额为:" + balance); this.balance = balance; } public double getBalance() { return balance; } }