Skip to content

Commit 63a019f

Browse files
Update README.md
1 parent f2209b9 commit 63a019f

File tree

1 file changed

+39
-58
lines changed

1 file changed

+39
-58
lines changed

README.md

Lines changed: 39 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
# Java OOP Fundamentals
1+
# Java OOP Foundations
22

3-
This repository contains Java programs demonstrating **Object-Oriented Programming (OOP)** concepts such as encapsulation, constructors, inheritance, and class design.
4-
It includes four tasks (1.1 to 1.4), each implemented using separate Java classes.
3+
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.
54

65
---
76

87
## 📁 Project Structure
98

109
```
11-
10+
src/
1211
├── Account.java
1312
├── Person.java
1413
├── Person_2.java
@@ -19,97 +18,79 @@ It includes four tasks (1.1 to 1.4), each implemented using separate Java classe
1918
│ ├── 1.2.a.png
2019
│ ├── 1.2.b.png
2120
│ ├── 1.3.png
22-
── 1.4.png
21+
── 1.4.png
2322
└── README.md
23+
└── LICENSE
2424
```
2525

2626
---
2727

28-
## 📘 Task Overview
28+
## 📝 Tasks Overview
2929

30-
### **🧩 Task 1.1 — Person Class**
31-
- Implements a `Person` class with:
32-
- `name`, `age`
33-
- Constructor + Display method
34-
- Default age = 18.
30+
### **Task 1.1 – Person Class**
31+
- Implements a `Person` class with `name` and `age`.
32+
- Default age is set to **18**.
33+
- Uses constructors and a display method.
3534

3635
📸 **Screenshot:**
3736
![Task 1.1](screenshots/1.1.png)
3837

3938
---
4039

41-
### **🧩 Task 1.2 — Product Class**
42-
- Defines a `Product` class with:
43-
- `pid`, `price`, `quantity`
44-
- Includes a main class to:
45-
- Input 5 products
46-
- Find product with highest price
47-
- Calculate total purchase amount
48-
49-
📸 **Screenshot A:**
50-
![Task 1.2a](screenshots/1.2.a.png)
40+
### **Task 1.2 – Product Class**
41+
Defines a `Product` class and a main driver that:
42+
- Accepts details of **5 products**
43+
- Finds the product with the **highest price**
44+
- Computes **total amount spent** (price × quantity)
5145

52-
📸 **Screenshot B:**
53-
![Task 1.2b](screenshots/1.2.b.png)
46+
📸 **Screenshots:**
47+
![1.2.a](screenshots/1.2.a.png)
48+
![1.2.b](screenshots/1.2.b.png)
5449

5550
---
5651

57-
### **🧩 Task 1.3 Account Class**
58-
- Balance management using:
59-
- Default constructor
60-
- Parameterized constructor
61-
- Deposit / Withdraw / Display methods
52+
### **Task 1.3 Account Class**
53+
Implements:
54+
- Default & parameterized constructors
55+
- Deposit and withdraw methods
56+
- Balance display
6257

6358
📸 **Screenshot:**
6459
![Task 1.3](screenshots/1.3.png)
6560

6661
---
6762

68-
### **🧩 Task 1.4 — Inheritance Example**
69-
- `Person` = Base class
70-
- `Employee` = Derived class
71-
- Uses:
72-
- `super()` for constructor chaining
73-
- Additional fields: employeeID, salary
63+
### **Task 1.4 – Inheritance (Person → Employee)**
64+
Contains `XYZ.java`:
65+
- Base class: `Person`
66+
- Subclass: `Employee`
67+
- Demonstrates constructor chaining using `super`
7468

7569
📸 **Screenshot:**
7670
![Task 1.4](screenshots/1.4.png)
7771

7872
---
7973

80-
## ▶️ Running the Programs
81-
82-
### **Clone the repository**
83-
```bash
84-
git clone https://github.com/TheComputationalCore/java-oop-foundations.git
85-
cd java-oop-foundations
86-
```
74+
## ▶️ How to Run
8775

88-
### **Compile**
8976
```bash
9077
javac *.java
9178
```
9279

93-
### **Run**
94-
```bash
95-
java Person # Task 1.1
96-
java Product # Task 1.2
97-
java Account # Task 1.3
98-
java XYZ # Task 1.4
99-
```
100-
101-
---
80+
Run a specific task:
10281

103-
## 🛠 Requirements
104-
- Java JDK 8 or higher
105-
- Any IDE or terminal that supports Java
82+
| Task | Command |
83+
|------|---------|
84+
| 1.1 | `java Person` |
85+
| 1.2 | `java Product` |
86+
| 1.3 | `java Account` |
87+
| 1.4 | `java XYZ` |
10688

10789
---
10890

109-
## ✔️ Notes
110-
- All tasks are independent and runnable separately.
111-
- Screenshots of all implementations are included in the `screenshots` folder.
91+
## 🧩 Requirements
92+
- Java JDK **8 or higher**
93+
- Any IDE or terminal
11294

11395
---
11496

115-
If you'd like badges, a CI pipeline, or a reorganized folder structure (e.g., `src/`), just let me know!

0 commit comments

Comments
 (0)