Skip to content
Advertisement

Does both Heap and Stack of Java reside in RAM, similar to C++?

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.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement