public class Account { private String accountNumber; private double balance; public Account(String accountNumber, double balance) { this.accountNumber = accountNumber; this.balance = balance; } public void withdraw(double amount) { if (amount < 0) { throw new IllegalArgumentException("Withdrawal amount cannot be negative."); } if (amount > balance) { throw new IllegalArgumentException("Insufficient funds."); } balance -= amount; } public double getBalance() { return balance; } }