Practice ยท 2 of 2
Bank Account with guarded money
Inside Solution, write static class Account with a private final String owner, private double balance, constructor Account(String owner, double startingBalance) (negative start โ IllegalArgumentException), public void deposit(double) (must be positive, else IAE), public void withdraw(double) (must be positive AND not exceed balance, else IAE), and public double getBalance().
Difficulty: beginner
Press Submit to check your solution.
Back to lesson: Practice: Practice: Objects at Work