This is a simple Bank Management System implemented in Java, demonstrating key Object-Oriented Programming (OOP) principles such as Abstraction, Encapsulation, Inheritance, and Polymorphism.
-
Account Class (Abstraction & Encapsulation)
- Private properties:
accountNumber,balance,ownerName - Public methods:
deposit(),withdraw(),getBalance() - Protected method:
setBalance()to allow controlled access for subclasses
- Private properties:
-
SavingsAccount (Inheritance)
- Adds
interestRate - Method
applyInterest()to apply interest on balance
- Adds
-
CurrentAccount (Inheritance)
- Adds
overdraftLimit - Method
setOverdraftLimit()to configure overdraft - Overrides
withdraw()to allow overdraft within limits
- Adds
-
Bank Class (Polymorphism)
- Manages multiple accounts
- Allows deposits, withdrawals, and balance checking for any account type
- Java
- OOP Principles
- Clone this repository:
git clone https://github.com/Houssemamor/javaBank.git
- Open the project in your favorite Java IDE (e.g., IntelliJ, Eclipse, VS Code).
- Compile and run
App.java. - Perform transactions such as deposits, withdrawals, and interest application.
/src
βββ Account.java # Base class (Encapsulation & Abstraction)
βββ SavingsAccount.java # Subclass with interest rate (Inheritance)
βββ CurrentAccount.java # Subclass with overdraft limit (Inheritance & Polymorphism)
βββ Bank.java # Manages multiple accounts (Polymorphism)
βββ App.java # Entry point to test the system
//WIPThis project is licensed under the MIT License - see the LICENSE file for details.
Feel free to fork the project and submit pull requests! π