## Class BankAccount

- java.lang.Object
- - BankAccount

-     public class BankAccount
      extends java.lang.Object

  A bank account has a balance that can be changed by deposits and withdrawals.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BankAccount()` Constructs a bank account with a zero balance.
    `BankAccount(double initialBalance)` Constructs a bank account with a given balance.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `deposit(double amount)` Deposits money into the bank account.
    `double` | `getBalance()` Gets the current balance of the bank account.
    `void` | `withdraw(double amount)` Withdraws money from the bank account.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### BankAccount

          public BankAccount()

      Constructs a bank account with a zero balance.

    - #### BankAccount

          public BankAccount(double initialBalance)

      Constructs a bank account with a given balance.
      Parameters:
        `initialBalance` - the initial balance

  - ### Method Detail

    - #### deposit

          public void deposit(double amount)

      Deposits money into the bank account.
      Parameters:
        `amount` - the amount to deposit

    - #### withdraw

          public void withdraw(double amount)

      Withdraws money from the bank account.
      Parameters:
        `amount` - the amount to withdraw

    - #### getBalance

          public double getBalance()

      Gets the current balance of the bank account.
      Returns:
        the current balance