1. What does the Java Memory Model (JMM) primarily define?
The JMM specifies when a thread’s write becomes visible to other threads and which re-orderings are allowed. It’s about visibility and happens-before guarantees, not physical layouts or GC details.