Computer Science, asked by bandinaga7918, 1 year ago

How are Java objects stored in memory?

Answers

Answered by taibak32
2

Answer

In Java, all objects are dynamically allocated on Heap. This is different from C++ where objects can be allocated memory either on Stack or on Heap. In C++, when we allocate the object using new(), the object is allocated on Heap, otherwise on Stack if not global or static.

Similar questions