Welcome to Java Mastery, a curated collection of hands-on Java examples designed to build a deep, practical understanding of core and advanced Java concepts.
This repository focuses on how Java actually works—from language features to build tooling—through runnable code and clear explanations.
Each topic includes:
- 📄 Well-documented Java code examples
- 📘 Markdown files explaining concepts and decisions
- 🖥️ Output screenshots or logs (where relevant)
- Java Version: 21
- Build Tools:
javac/javafor standalone, language-focused examples- Maven for topics involving build tooling (e.g., JAR packaging)
Each folder is self-contained.
Instructions or assumptions specific to a topic are documented inside that folder.
try-catch, multi-catch,finally- Try-with-resources
- Custom and chained exceptions
- Common pitfalls and best practices
- Type safety and invariance
- Generic classes and methods
- Wildcards (
? extends,? super) - Type erasure and its implications
- Deconstructing immutable data
- Pattern matching in
switchandif - Cleaner, safer data access with records
- Ordered access to first/last elements
- New APIs for lists, sets, and maps
- Intermediate vs terminal operations
- What a JAR really is
- Thin JAR vs Fat (Uber) JAR
- Real troubleshooting from local builds
Planned additions with runnable examples and documentation:
- EAR and WAR
This repository documents my journey toward true Java mastery; not just using APIs, but understanding the runtime, tooling, and design trade-offs behind them.
The goal is clarity over abstraction, correctness over shortcuts, and learning by doing.
This project is licensed under the MIT License.