This repository contains Java programs demonstrating fundamental Object-Oriented Programming (OOP) concepts such as encapsulation, inheritance, and basic class design. It includes four tasks (1.1 to 1.4), each illustrating a different OOP principle.
java-oop-fundamentals/
│
├── .github/
│ └── workflows/
│ └── java-build.yml
│
├── screenshots/
│ ├── 1.1.png
│ ├── 1.2.a.png
│ ├── 1.2.b.png
│ ├── 1.3.png
│ └── 1.4.png
│
├── src/
│ ├── Account.java
│ ├── Person.java
│ ├── Person_2.java
│ ├── Product.java
│ └── XYZ.java
│
├── LICENSE
└── README.md
- Implements a
Personclass withnameandage. - Default age is 18.
- Includes constructor + method to display info.
- Represents products with
pid,price, andquantity. ProductMain:- Accepts 5 products.
- Finds highest price product.
- Calculates total expenditure.
- Implements
deposit,withdraw, anddisplaymethods. - Includes default + parameterized constructors.
EmployeeextendsPerson.- Adds
employeeIDandsalary. - Uses
super()for parent initialization.
git clone https://github.com/TheComputationalCore/java-oop-fundamentals.git
cd java-oop-fundamentals/srcjavac *.javajava Person
java Product
java Account
java XYZ- Java JDK 8 or higher
- Any terminal or Java IDE
This project is licensed under the MIT License.




