Heap, Stack and Metaspace in Java
Where each piece of data actually lives, and what runs out when each area is exhausted.
Interview preparation material.
165 notes tagged
Where each piece of data actually lives, and what runs out when each area is exhausted.
The class loader, the runtime data areas and the execution engine, and how a class file becomes running machine code.
The rules that decide when a write by one thread becomes visible to another, expressed as the happens-before relationship.
The two failures that define concurrency: results that depend on timing, and threads that wait for each other forever.
synchronized gives mutual exclusion and visibility. volatile gives visibility only, and knowing the difference prevents most concurrency bugs.
A thread moves through six states, and knowing which one it is in is the first step in diagnosing any hang.
A thread is an independent path of execution inside one process, and Java gives you several ways to start one.
A parallel stream splits the work across threads. It helps less often than people expect, and it breaks silently when the rules are ignored.
A stream describes a computation over a sequence of elements. You state what you want, and the pipeline decides how to walk the data.
Optional makes absence part of the type, so a caller cannot forget that a value might not be there.
Generic type information exists only at compile time. Knowing what the compiler removes explains every generics restriction.
Bounds restrict what a type parameter may be, and wildcards let a method accept a family of parameterised types safely.