Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
bgColor#ffcccc
package account;
import user.User;
public class AccountHolder {

  private User user;
  public void setUser(User newUser) {user = newUser;}
 
  synchronized void depositFunds(String username, double amount) {
    // Use a utility method of User to check whether username exists
    if (user.exists(username)) { 
      // Deposit the amount
    } 
  }

  protected double getBalance(String accountNumber) { 
    // returnReturn the account balance 
    return 1.0; 
  }
}

...