A one‑stop, hands‑on reference for learning, revising and practising core Java – from syntax basics to interview‑level algorithms.
| Category | What’s inside | Why it matters |
|---|---|---|
| Foundations | Hello‑world programs, data‑types, operators, control‑flow | Build rock‑solid basics that never fail you in exams or live coding rounds. |
| OOP Essentials | Classes & objects, this, constructors, inheritance, interfaces, polymorphism, encapsulation, abstraction | Crack every “explain vs demonstrate” question with runnable code examples. |
| Core APIs | java.lang, java.util, java.time, Wrapper classes & autoboxing | Daily‑driver utilities you’ll actually use in projects. |
| Collections Framework | List, Set, Map, plus ArrayList/LinkedList/HashSet/TreeSet/HashMap/TreeMap | Master internal workings & pick the right container in interviews. |
| Exceptions | Checked vs unchecked, try/catch/finally, custom exceptions | Write safe code & answer advanced theory on the spot. |
| Java 8+ Goodies | Lambda expressions, functional interfaces, streams, method references | Modern Java skills that impress recruiters. |
| Multithreading | Thread life‑cycle, Runnable, synchronisation, ExecutorService | Build intuition for concurrency questions and projects. |
| File I/O & NIO | Read/write, buffered streams, path API | Real‑world data handling. |
| Algorithms & DSA | Matrix traversals, string algorithms, linked lists, stacks, queues, trees, graphs | End‑to‑end solutions with complexity notes – perfect for DS‑Algo prep. |
| Interview Corner | Top MCQs, scenario questions, coding challenges | Quick revision before the big day. |
The repo currently has classes/, codes/, and assorted .java files at root. To make navigation easier, consider this structure (folders map 1‑to‑1 with the table above):
java-core/ ├── 01_basics/ │ └── ... ├── 02_oop/ ├── 03_core-apis/ ├── 04_collections/ ├── 05_exceptions/ ├── 06_java8+/ # Lambda, Streams, etc. ├── 07_multithreading/ ├── 08_io-nio/ ├── 09_dsa-algorithms/ │ ├── arrays/ │ ├── strings/ │ ├── linked-lists/ │ ├── trees/ │ └── graphs/ └── 10_interview-corner/ ├── mcqs/ ├── theory/ └── coding-challenges/
shell Copy Edit
Tip: Use IntelliJ or VS Code’s "Move File" to refactor gradually – Git will retain commit history.
# 1. Clone the repo $ git clone https://github.com/sparshsharma81/JAVA.git $ cd JAVA # 2. Compile any example (uses Java 17 by default) $ javac 01_basics/HelloWorld.java $ java HelloWorld If you’re on Java 8, change the source path accordingly or add --release 8. 🧠 Learning path Read the markdown notes in each folder. Run the accompanying .java files – each is self‑contained and has comments explaining edge‑cases & time complexity. Practice the Interview Corner problems; submit on LeetCode/HackerRank for extra confidence. Revise with the lightning‑fast MCQs before exams or interviews. Minimal theory → lots of runnable code → spaced repetition quizzes. That’s the mantra here. 🤝 Contributing Pull requests are welcome! Fork the repo & create your branch: git checkout -b feature/MyAwesomeAlgo Add code inside the correct folder and include a short README.md explaining what it solves. Run ./gradlew test (coming soon) to keep builds green. Submit a PR – briefly describe the change & reference any related issues. Please follow the existing naming convention: snake_case for file names, camelCase for variables, and 2‑space indentation. 📜 License This repository is licensed under the MIT License – see LICENSE for details. 👋 Author Sparsh Sharma Passionate CS student | Java & Web dev enthusiast | Always learning & sharing. LinkedIn · Portfolio If you find this repo helpful, please ⭐ star it and share with your friends! Happy Coding ☕! yaml Copy Edit --- Let me know if you'd like badges, a TOC, or image previews added at the top!