How are Java objects stored in memory?
Answers
Answered by
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
Economy,
7 months ago
English,
7 months ago
Computer Science,
1 year ago
Math,
1 year ago
Physics,
1 year ago