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.
Feel free to open PRs, file issues, or suggest improvements!













