This is a simple console banking application written in Java. It demonstrates object-oriented design, menu-driven flow, and exception handling using an in-memory account store.
All logic is currently implemented in a single source file: Bank.java.
- Create a new account with name and initial balance
- Auto-generate account numbers (starting from
1000) - Access existing accounts using account number
- Deposit money
- Withdraw money
- Check current balance
- Handle common errors gracefully:
- negative/zero deposit or withdrawal
- negative initial balance
- insufficient balance
- invalid menu choices
The project currently contains:
Bank.java
Inside Bank.java, the following classes are defined:
InsufficientFundsExceptionBankAccountBankServiceAccountMenuBank(main entry point)
- User sees the main menu:
- Create new account
- Access existing account
- Exit
- On account creation, a new account number is generated and stored in memory.
- After creating or opening an account, user enters account operations menu:
- Deposit
- Withdraw
- Check balance
- Exit
- Data is stored only for the current runtime session.
Compile and run:
javac Bank.java
java Bank- No database or file persistence is used.
- Accounts are stored in a
HashMap<Integer, BankAccount>. - This project is intended for Java fundamentals practice.