A structured, hands-on collection of Java concepts, exercises, and projects — from absolute beginner to confident developer.
This repository is organized by topic and difficulty level. Each section contains:
- Concept notes with clear explanations
- Code examples you can run immediately
- Exercises to test your understanding
- Solutions (in a separate folder — try first!)
java-learning/
├── 01-basics/
│ ├── variables-and-types/
│ ├── operators/
│ ├── control-flow/
│ └── loops/
├── 02-oop/
│ ├── classes-and-objects/
│ ├── inheritance/
│ ├── polymorphism/
│ ├── abstraction/
│ └── encapsulation/
├── 03-core-java/
│ ├── strings/
│ ├── arrays/
│ ├── collections/
│ ├── generics/
│ └── exceptions/
├── 04-advanced/
│ ├── streams-and-lambdas/
│ ├── multithreading/
│ ├── file-io/
│ └── design-patterns/
├── 05-projects/
│ ├── bank-account-system/
│ ├── student-management/
│ └── mini-library/
└── solutions/
- Java JDK 17+ — Download here
- An IDE — IntelliJ IDEA (recommended) or VS Code with Java extension
- Git — to clone this repo
# Clone the repository
git clone https://github.com/your-username/java-learning.git
cd java-learning
# Verify Java is installed
java --version
# Compile and run any example
javac 01-basics/variables-and-types/HelloWorld.java
java HelloWorld01-basics— Syntax, variables, data types, operators01-basics/control-flow— if/else, switch statements01-basics/loops— for, while, do-while, enhanced for
02-oop— The four pillars of Object-Oriented Programming03-core-java/strings— String manipulation and methods03-core-java/arrays— Arrays and multi-dimensional arrays03-core-java/collections— List, Set, Map and when to use each03-core-java/exceptions— Try-catch, custom exceptions
03-core-java/generics— Type-safe code with generics04-advanced/streams-and-lambdas— Functional programming in Java04-advanced/multithreading— Concurrency and thread safety04-advanced/design-patterns— Common patterns like Singleton, Factory, Observer
Applying everything learned in 05-projects/.
- Read the concept notes in each folder (
README.mdorNotes.md) - Study the example files (e.g.,
Example.java) - Attempt the exercises in
Exercise.java(look for// TODOcomments) - Check your work against
solutions/— only after you've tried! - Experiment — modify the examples and see what happens
| Topic | Status |
|---|---|
| Variables & Data Types | 📋 Planned |
| Control Flow | 📋 Planned |
| Loops | 📋 Planned |
| Methods | 📋 Planned |
| Classes & Objects | 📋 Planned |
| Inheritance | 📋 Planned |
| Interfaces & Abstract Classes | 📋 Planned |
| Collections Framework | 📋 Planned |
| Exception Handling | 📋 Planned |
| Generics | 📋 Planned |
| Streams & Lambdas | 📋 Planned |
| File I/O | 📋 Planned |
| Multithreading | 📋 Planned |
| Design Patterns | 📋 Planned |
| Unit Testing (JUnit) | 📋 Planned |
| Spring Boot Basics | 📋 Planned |
Contributions are welcome! If you'd like to add examples, fix bugs, or improve explanations:
- Fork the repository
- Create a branch:
git checkout -b feature/add-topic-name - Commit your changes:
git commit -m "Add examples for topic X" - Push and open a Pull Request
Please keep code clean, well-commented, and beginner-friendly.
- Official Java Documentation
- Baeldung — practical Java tutorials
- Java Programming MOOC — free university course
- Effective Java by Joshua Bloch — must-read for intermediate+
This repository is licensed under the MIT License. Feel free to use, share, and modify for learning purposes.
"Java is to JavaScript what car is to carpet." — Keep learning, keep coding. ☕