This repository contains a basic simulation of a banking system implemented in Java. The project demonstrates the principles of Object-Oriented Programming (OOP) such as inheritance and encapsulation.
The system supports operations like deposit and withdrawal for different types of bank accounts: Regular, Overdraft, and Joint Overdraft. It includes validation checks and custom exceptions for various potential issues such as insufficient balance, invalid social security numbers, or withdrawal amounts.
User
: Represents a user or account holder with properties like first name, last name, and social security number.Account
: Represents a bank account with operations like deposit and withdrawal.JointAccount
: Inherits fromAccount
and represents a bank account jointly held by two users.OverdraftAccount
: Inherits fromAccount
and represents an overdraft account, which allows for negative balance.OverdraftJointAccount
: Inherits fromJointAccount
and represents a joint overdraft account.
Additionally, the IdentifiableEntity
class is used as a base class for entities that require a unique identifier.
InsufficientAmountException
: Thrown when the deposit or withdrawal amount is zero or negative.InsufficientBalanceException
: Thrown when the withdrawal amount exceeds the account balance.SsnNotValidException
: Thrown when the social security number provided does not match the account holder's.
The project can be run using any Java IDE or from the command line by compiling the java files and running the Main.java file.