This repository contains advanced Java exercises (Q1–Q5) focusing on:
- Custom Exception Handling
- Input Validation
- Java Collections Framework
- HashMap operations
- Stack implementation
- User‑driven logic & error handling
All tasks include screenshots, organized source code, and a fully automated CI workflow.
java-advanced-exceptions-collections/
│
├── .github/workflows/
│ └── java-build.yml
│
├── screenshots/
│ ├── 1.a.png
│ ├── 1.b.png
│ ├── 1.c.png
│ ├── 1.d.png
│ ├── 2.a.png
│ ├── 2.b.png
│ ├── 3.a.png
│ ├── 3.b.png
│ ├── 3.c.png
│ ├── 4.a.png
│ ├── 4.b.png
│ ├── 4.c.png
│ ├── 4.d.png
│ └── 5.png
│
├── src/
│ ├── AgeNotWithinRangeException.java
│ ├── NameNotValidException.java
│ ├── Student.java
│ ├── Voter.java
│ ├── QuestionThree.java
│ ├── QuestionFour.java
│ ├── QuestionFive.java
│ └── (supporting logic)
│
├── LICENSE
└── README.md
Validates:
- Age must be between 15–21
- Name must not contain numbers or special symbols
Uses two custom exceptions:
AgeNotWithinRangeExceptionNameNotValidException
Ensures:
- Age ≥ 18
Else throws Invalid Age Exception.
- Takes a day index as input
- Prints weekday name
- Handles:
- Invalid numeric input
- Array out‑of‑bounds cases
Supports:
- Add student + grade
- Remove student
- Fetch grade
Uses:
HashMap<String, Integer>Operations:
push()pop()isEmpty()
Uses:
Stack<Integer>![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
git clone https://github.com/TheComputationalCore/java-advanced-exceptions-collections.gitcd java-advanced-exceptions-collections/srcjavac *.javajava Student # Q1
java Voter # Q2
java QuestionThree # Q3
java QuestionFour # Q4
java QuestionFive # Q5Distributed under the MIT License.













