This is a console-based banking application developed for the Rural Bank of Nepal (RBN) to support financial inclusion in remote areas. The system implements core banking operations while adhering to object-oriented programming principles.
BankAccount serves as the base class with common attributes and abstract methodsTransaction interface defines the contract for banking operationsgetAccountType() must be implemented by concrete classesSavingsAccount extends BankAccountCurrentAccount extends BankAccountbalance to allow child class accesswithdraw() method behaves differently in savings vs current accountsCustomer class contains a collection of BankAccount objectsSavings Account
Current Account
InsufficientBalanceExceptionjavac *.javajava RuralBankSystem├── Transaction.java (Interface)
├── InsufficientBalanceException.java (Custom Exception)
├── BankAccount.java (Abstract Base Class)
├── SavingsAccount.java (Concrete Implementation)
├── CurrentAccount.java (Concrete Implementation)
├── Customer.java (Aggregation Class)
└── RuralBankSystem.java (Main Application)
This implementation demonstrates comprehensive OOP principles while providing a practical banking solution for rural communities.
## Screenshots and Testing
Here are the key operations you should test:
1. **Account Creation and Deposit**:
- Create both savings and current accounts
- Test deposit functionality
2. **Withdrawal with Exception Handling**:
- Try withdrawing more than balance from savings account
- Test overdraft functionality in current account
3. **Interest Addition**:
- Add interest to savings accounts
- Verify balance updates
The system implements all required OOP concepts:
- **Abstraction**: Abstract `BankAccount` class and `Transaction` interface
- **Inheritance**: `SavingsAccount` and `CurrentAccount` extend `BankAccount`
- **Encapsulation**: Private data members with public getters/setters
- **Polymorphism**: Overridden `withdraw()` methods behave differently
- **Aggregation**: `Customer` class contains multiple `BankAccount` objects
The custom exception handling ensures robust error management, and the console interface provides an intuitive user experience suitable for rural banking scenarios.