|
1 | 1 | # Java OOP Interfaces, Abstraction & Class Relationships |
2 | 2 |
|
| 3 | +🚀 **Master OOP with Real‑World Java Implementations** |
| 4 | + |
3 | 5 |  |
4 | 6 |  |
5 | 7 |  |
6 | 8 |  |
7 | 9 |
|
8 | | -This repository contains Java programs demonstrating essential Object-Oriented Programming (OOP) concepts such as **encapsulation, abstraction, interfaces, and class relationships**. The project is organized into **two major tasks**: |
| 10 | +This repository demonstrates essential **Object‑Oriented Programming (OOP)** concepts including |
| 11 | +**encapsulation**, **abstraction**, **interfaces**, and **class relationships** through two real-world tasks: |
9 | 12 |
|
10 | | -1. **Library Management System** |
11 | | -2. **Taxable Interface Implementation** |
| 13 | +1. **Library Management System** |
| 14 | +2. **Taxable Interface: Employee & Product Tax Calculation** |
12 | 15 |
|
13 | 16 | --- |
14 | 17 |
|
@@ -38,91 +41,90 @@ java-oop-interfaces-abstraction/ |
38 | 41 | │ |
39 | 42 | ├── LICENSE |
40 | 43 | └── README.md |
41 | | -
|
42 | 44 | ``` |
43 | 45 |
|
44 | | -### File Overview |
45 | | -- **Book.java** – Defines the `Book` class with attributes `bookID`, `title`, `author`, and `isAvailable`. |
46 | | -- **Library.java** – Manages an array of `Book` objects; methods to add, remove, search, and display books. |
47 | | -- **Taxable.java** – Interface defining constants `salesTax`, `incomeTax`, and abstract method `calcTax()`. |
48 | | -- **Employee.java** – Implements `Taxable` to compute income tax. |
49 | | -- **Product.java** – Implements `Taxable` to compute sales tax. |
50 | | -- **Main.java** – Driver for tax calculations. |
51 | | - |
52 | 46 | --- |
53 | 47 |
|
54 | 48 | # 📘 Task 1 — Library Management System |
55 | 49 |
|
56 | | -### Book Class |
| 50 | +### **Book Class** |
57 | 51 | Represents: |
58 | 52 | - `bookID` |
59 | 53 | - `title` |
60 | 54 | - `author` |
61 | 55 | - `isAvailable` |
62 | 56 |
|
63 | | -### Library Class |
64 | | -Supports: |
65 | | -✔ Add books |
66 | | -✔ Remove books |
67 | | -✔ Search by ID |
68 | | -✔ Display all books |
| 57 | +### **Library Class** |
| 58 | +Provides: |
| 59 | +- ➕ Add books |
| 60 | +- ➖ Remove books |
| 61 | +- 🔍 Search by ID |
| 62 | +- 📋 Display all books |
| 63 | + |
| 64 | +### 📸 Screenshots (Task 1) |
| 65 | +| 1.a | 1.b | |
| 66 | +|-----|-----| |
| 67 | +|  |  | |
69 | 68 |
|
70 | | -### 📸 Screenshots |
71 | | - |
72 | | - |
73 | | - |
74 | | - |
| 69 | +| 1.c | 1.d | |
| 70 | +|-----|-----| |
| 71 | +|  |  | |
75 | 72 |
|
76 | 73 | --- |
77 | 74 |
|
78 | 75 | # 🧮 Task 2 — Taxable Interface Implementation |
79 | 76 |
|
80 | | -### Taxable Interface |
| 77 | +### **Taxable Interface** |
81 | 78 | Defines: |
82 | 79 | - `salesTax = 0.07` |
83 | 80 | - `incomeTax = 0.105` |
84 | | -- Abstract method `calcTax()` |
| 81 | +- Method: `calcTax()` |
85 | 82 |
|
86 | | -### Employee Class |
87 | | -Computes **income tax** based on salary. |
| 83 | +### **Employee Class** |
| 84 | +✔ Calculates **income tax** from salary. |
88 | 85 |
|
89 | | -### Product Class |
90 | | -Computes **sales tax** based on price. |
| 86 | +### **Product Class** |
| 87 | +✔ Calculates **sales tax** from price. |
91 | 88 |
|
92 | | -### 📸 Screenshot |
93 | | - |
| 89 | +### 📸 Screenshot (Task 2) |
| 90 | + |
94 | 91 |
|
95 | 92 | --- |
96 | 93 |
|
97 | | -# ▶️ Running the Programs |
| 94 | +# ▶️ How to Run |
98 | 95 |
|
99 | | -### Clone |
| 96 | +### **Clone Repository** |
100 | 97 | ```bash |
101 | 98 | git clone https://github.com/TheComputationalCore/java-oop-interfaces-abstraction.git |
102 | 99 | ``` |
103 | 100 |
|
104 | | -### Compile |
| 101 | +### **Navigate** |
| 102 | +```bash |
| 103 | +cd java-oop-interfaces-abstraction/src |
| 104 | +``` |
| 105 | + |
| 106 | +### **Compile** |
105 | 107 | ```bash |
106 | 108 | javac *.java |
107 | 109 | ``` |
108 | 110 |
|
109 | | -### Run Task 1 |
| 111 | +### **Run Task 1** |
110 | 112 | ```bash |
111 | 113 | java Library |
112 | 114 | ``` |
113 | 115 |
|
114 | | -### Run Task 2 |
| 116 | +### **Run Task 2** |
115 | 117 | ```bash |
116 | 118 | java Main |
117 | 119 | ``` |
118 | 120 |
|
119 | 121 | --- |
120 | 122 |
|
121 | | -# Requirements |
122 | | -- Java JDK 8+ |
123 | | -- Terminal or IDE |
| 123 | +# 🛠 Requirements |
| 124 | +- Java **JDK 8+** |
| 125 | +- Terminal / Command Prompt / IDE (IntelliJ, VS Code, Eclipse) |
124 | 126 |
|
125 | 127 | --- |
126 | 128 |
|
127 | 129 | # 📝 License |
128 | | -This project is licensed under the **MIT License**. |
| 130 | +Licensed under the **MIT License**. |
0 commit comments