Java Revision — Concept && Coding (Shrayansh Jain)
Structured notes + runnable examples for every topic in Shrayansh's
JAVA from Basics to Advanced playlist. Each package has:
- NOTES.md — concise concepts, gotchas, and interview angles
- Demo.java (and supporting classes) — runnable examples
# compile everything
javac -d target/classes $(find src/main/java -name "*.java")
# run a single demo
java -cp target/classes revision._25_hashmap_internals.Demo
# run everything
bash run_all.sh
Part 1 — OOP & language foundations
- OOP — four pillars
- JVM, JRE, JDK
- Why only one public class per file
- Variables — primitive types
- IEEE 754 — float/double memory layout
- Variables — reference types
- Methods
- Constructors
- Memory management & GC
Part 2 — Classes & interfaces
- Nested / Abstract / Super-Sub classes
- Generic classes
- Enum, POJO, Final
- Singleton & Immutable
- Interfaces — Part 1
- Interfaces — Part 2 (default/static/private, Java 8/9)
- Functional Interfaces & Lambdas
- Reflection
- Annotations
Part 3 — Language essentials
- Exception handling
- Operators
- Control flow
Part 4 — Collections & Streams
- Collections framework overview
- Comparator vs Comparable, PriorityQueue
- Deque & List
- HashMap internals
- LinkedHashMap & TreeMap
- Set
- Streams (Java 8)
Part 5 — Multithreading & Concurrency
- Threads, Process, Memory model
- Thread lifecycle & inter-thread communication
- Join, Daemon, Priority
- Locks & Conditions (Reentrant, ReadWrite, Stamped, Semaphore)
- Lock-free concurrency (CAS, Atomic, Volatile)
- ThreadPoolExecutor framework
- CompletableFuture / Future / Callable
- ForkJoinPool & specialized pools
- ScheduledExecutor, shutdown vs awaitTermination
- Virtual Threads vs Platform Threads, ThreadLocal
Part 6 — Modern Java features
- Optional (Java 8-11)
- Text blocks (Java 15)
- Records (Java 16)
- Pattern matching for instanceof (Java 16)
- Sealed classes & interfaces (Java 17)
- Switch expressions (Java 14)
- Pattern matching for switch (Java 21)
- Sequenced collections (Java 21)
- File handling — Streams, Buffers, Readers, Writers
- NIO Part 1 — advantages over traditional I/O
- NIO Part 2 — ByteBuffer variants
- NIO Part 3 — FileChannel