In Java, memory is divided into which two types of memory?
- Memory is divided into stack and heap.
- Stack is further subdivided into per-thread stack.
- Variables local to the thread live on the stack as they need not be shared with any other thread
- Heap is the common place where objects live so that they can be share amongst different threads each having its own stack.
- For concurrent updation of objects in different threads, we must synchronize before accessing the objects



1 comment