Skip to content

Commit b53dc1a

Browse files
Update README.md
1 parent 396532b commit b53dc1a

File tree

1 file changed

+114
-88
lines changed

1 file changed

+114
-88
lines changed

README.md

Lines changed: 114 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,136 +1,162 @@
1-
# Java Advanced: Exception Handling & Collections
1+
# Java Advanced: Exception Handling & Collections
22

3-
This repository showcases **advanced Java concepts**, focusing on **custom exceptions**, **robust error handling**, and **Java Collections Framework** usage.
4-
It includes **five fully implemented tasks (Q1–Q5)** accompanied by code screenshots for clarity and reference.
3+
![Build Status](https://github.com/TheComputationalCore/java-advanced-exceptions-collections/actions/workflows/java-build.yml/badge.svg)
4+
![License](https://img.shields.io/badge/License-MIT-yellow.svg)
5+
![Java](https://img.shields.io/badge/Java-100%25-orange)
6+
![Repo Size](https://img.shields.io/github/repo-size/TheComputationalCore/java-advanced-exceptions-collections)
7+
8+
---
9+
10+
## 📚 Overview
11+
12+
This repository showcases **advanced Java concepts**, focusing on:
13+
14+
- Custom exception handling
15+
- Collections framework usage
16+
- Stack implementation
17+
- HashMaps
18+
- Array exception management
19+
20+
It contains **five structured tasks (Q1–Q5)**, each reinforced with code screenshots laid out in elegant grids.
21+
22+
---
23+
24+
## 🛠️ Tech Stack
25+
26+
| Language | Paradigm | Topics |
27+
|---------|----------|--------|
28+
| **Java 8+** | OOP, Exception Handling | Collections, Custom Exceptions, Stack, HashMap |
529

630
---
731

832
## 📁 Project Structure
933

1034
```
11-
├── AgeNotWithinRangeException.java # Custom exception for invalid student age
12-
├── NameNotValidException.java # Custom exception for invalid name
13-
├── Student.java # Student class using custom exceptions (Q1)
14-
├── Voter.java # Voter class with age validation (Q2)
15-
├── QuestionThree.java # Weekday array + exception handling (Q3)
16-
├── QuestionFour.java # HashMap for student grades (Q4)
17-
├── QuestionFive.java # Stack implementation using collections (Q5)
18-
├── Screenshots/
19-
│ ├── 1.a.png 1.b.png 1.c.png 1.d.png
20-
│ ├── 2.a.png 2.b.png
21-
│ ├── 3.a.png 3.b.png 3.c.png
22-
│ ├── 4.a.png 4.b.png 4.c.png 4.d.png
23-
│ └── 5.png
24-
└── README.md
35+
src/
36+
├── AgeNotWithinRangeException.java
37+
├── NameNotValidException.java
38+
├── Student.java
39+
├── Voter.java
40+
├── QuestionThree.java
41+
├── QuestionFour.java
42+
├── QuestionFive.java
43+
└── screenshots/
44+
├── 1.a.png
45+
├── 1.b.png
46+
├── 1.c.png
47+
├── 1.d.png
48+
├── 2.a.png
49+
├── 2.b.png
50+
├── 3.a.png
51+
├── 3.b.png
52+
├── 3.c.png
53+
├── 4.a.png
54+
├── 4.b.png
55+
├── 4.c.png
56+
├── 4.d.png
57+
└── 5.png
2558
```
2659

2760
---
2861

29-
## 🧩 Task Overviews
62+
# 📝 Tasks Overview
63+
64+
---
65+
66+
# **Q1 — Student Management System (Custom Exceptions)**
67+
68+
### ✔ Validates:
69+
- Age range (15–21)
70+
- Name characters (no digits/symbols)
3071

31-
### **Q1 — Student Management System (Custom Exceptions)**
32-
Implements:
33-
- `Student` class with:
34-
- `rollNo`, `name`, `age`, `course`
35-
- Custom exceptions:
36-
- **AgeNotWithinRangeException** → age must be between **15–21**
37-
- **NameNotValidException** → name must contain only letters
38-
- Validates input using constructor-based rules.
72+
### ✔ Custom Exceptions:
73+
- `AgeNotWithinRangeException`
74+
- `NameNotValidException`
3975

40-
📸 **Screenshots:**
41-
![screenshots](1.c.png)
42-
![1.d](1.d.png)
76+
### 📸 Screenshots
77+
| 1.a | 1.b |
78+
|---|---|
79+
| ![](screenshots/1.a.png) | ![](screenshots/1.b.png) |
80+
81+
| 1.c | 1.d |
82+
|---|---|
83+
| ![](screenshots/1.c.png) | ![](screenshots/1.d.png) |
4384

4485
---
4586

46-
### **Q2 — Voter Age Validation**
47-
`Voter` class validates:
48-
- Age must be **18 or above**
49-
- Throws an exception for invalid age
87+
# **Q2 — Voter Age Validation**
88+
89+
Throws exception if voter age < 18.
5090

51-
📸 **Screenshots:**
52-
![2.a](2.a.png)
53-
![2.b](2.b.png)
91+
### 📸 Screenshots
92+
| 2.a | 2.b |
93+
|---|---|
94+
| ![](screenshots/2.a.png) | ![](screenshots/2.b.png) |
5495

5596
---
5697

57-
### **Q3 — Weekday Array + Exception Handling**
58-
- Stores weekday names in an array (index 0 = Sunday)
59-
- Accepts user index input
60-
- Handles:
61-
- **ArrayIndexOutOfBoundsException**
62-
- Prints helpful error message
98+
# **Q3 — Weekday Array Handling**
99+
100+
Handles `ArrayIndexOutOfBoundsException` for invalid day index.
101+
102+
### 📸 Screenshots
103+
| 3.a | 3.b |
104+
|---|---|
105+
| ![](screenshots/3.a.png) | ![](screenshots/3.b.png) |
63106

64-
📸 **Screenshots:**
65-
![3.a](3.a.png)
66-
![3.b](3.b.png)
67-
![3.c](3.c.png)
107+
| 3.c ||
108+
|---|---|
109+
| ![](screenshots/3.c.png) | |
68110

69111
---
70112

71-
### **Q4 — Student Grades Using HashMap**
72-
Implements:
113+
# **Q4 — Student Grades with HashMap**
114+
115+
Enables:
73116
- Add student + grade
74117
- Remove student
75118
- Display grade by name
76119

77-
Uses Java **HashMap** to store key–value pairs.
120+
### 📸 Screenshots
121+
| 4.a | 4.b |
122+
|---|---|
123+
| ![](screenshots/4.a.png) | ![](screenshots/4.b.png) |
78124

79-
📸 **Screenshots:**
80-
![4.a](4.a.png)
81-
![4.b](4.b.png)
82-
![4.c](4.c.png)
83-
![4.d](4.d.png)
125+
| 4.c | 4.d |
126+
|---|---|
127+
| ![](screenshots/4.c.png) | ![](screenshots/4.d.png) |
84128

85129
---
86130

87-
### **Q5 — Stack Implementation Using Collections**
88-
Implements:
89-
- `push()`
90-
- `pop()`
91-
- `isEmpty()`
131+
# **Q5 — Stack Implementation (Collections)**
92132

93-
Built using a Java **Stack** or similar collection class.
133+
Implements push, pop, isEmpty using Java Collections.
94134

95-
📸 **Screenshot:**
96-
![5](5.png)
135+
### 📸 Screenshot
136+
| 5 |
137+
|---|
138+
| ![](screenshots/5.png) |
97139

98140
---
99141

100-
## ▶️ How to Run
142+
# ▶️ How to Run
101143

102-
### **1. Clone the Repository**
103-
```bash
104-
git clone https://github.com/thesoulseizure/task-4.git
105-
cd task-4
106-
```
107-
108-
### **2. Compile All `.java` Files**
109144
```bash
145+
git clone https://github.com/TheComputationalCore/java-advanced-exceptions-collections.git
146+
cd java-advanced-exceptions-collections
110147
javac *.java
148+
java Student # Q1
149+
java Voter # Q2
150+
java QuestionThree # Q3
151+
java QuestionFour # Q4
152+
java QuestionFive # Q5
111153
```
112154

113-
### **3. Run Any Task**
114-
115-
| Task | Command |
116-
|------|----------|
117-
| Q1 — Student | `java Student` |
118-
| Q2 — Voter | `java Voter` |
119-
| Q3 — Weekday Array | `java QuestionThree` |
120-
| Q4 — HashMap Grades | `java QuestionFour` |
121-
| Q5 — Stack | `java QuestionFive` |
122-
123155
---
124156

125-
## 📌 Requirements
126-
- **JDK 8 or higher**
127-
- Any IDE or terminal that can compile and run Java programs
157+
# 📄 License
128158

129-
---
130-
131-
## 📄 License
132-
This project is for **educational purposes** and demonstrates core Java error-handling & collections concepts.
159+
Distributed under the MIT License.
133160

134161
---
135162

136-

0 commit comments

Comments
 (0)