This question is not about difference between Stack and Heap in Java. In C++, both Stack and Heap are in RAM. How is it in Java?
Advertisement
Answer
Yes. Stack is used for static memory allocation and Heap for dynamic memory allocation, both stored in the computer’s RAM
This is to ensure faster processing of java programs.