Want to create a thread in Java without extending `Thread`?
I explained it simply in my latest ByteCraft article.

Want to create a thread in Java without extending `Thread`?
I explained it simply in my latest ByteCraft article.
Stack or Heap? π€
`User user = new User();`
Where does `user` go?
Where does the object go?
Understanding Stack vs Heap helps explain:
πΉ GC
πΉ Memory leaks
πΉ StackOverflowError
πΉ OutOfMemoryError
I explained it simply π
Heap, Stack, Method Areaβ¦ π΅βπ«
Where does Java actually store data?
The Heap stores objects. Each thread has its own Stack. The Method Area stores class information.
I explained JVM memory with examples and common errors π
Java has Garbage Collection, but it doesn't fix every memory problem. π
GC checks whether objects are still reachable. If not, they become eligible for collection.
I explained Heap, GC Roots, G1, ZGC & memory leaks.
*Why is `String` immutable in Java? π€*
How do you make your own class immutable?
I explained immutable objects, defensive copying, `String`, thread safety, `HashMap` keys, and common interview questions in my new ByteCraft article.