+ 4

How does one correctly draw memory allocation diagrams from java code?

More specifically memory allocation diagrams of a stack object in its initial (size of object {or array size}, top {location of node in array} have been initialized to -1 {because it is empty}, and an array has been created to store the reference variables to the nodes' location), intermediate (nodes have been pushed), and full states (next push will generate an overflow error). Do the reference variables always start at 300, and the next is 44, followed by 100 then 600?

16th Aug 2018, 4:04 PM
Margie 🐣
Margie 🐣 - avatar
1 Answer
+ 3
no Margie 🐣 the reference variables not always start with 300 or any number ....but the memory allocation is done by the pointers which points (you can say that the variables is pointed with reference) which acts to story the address but the allocation is different
20th Aug 2018, 4:58 AM
Yesh Jadav
Yesh Jadav - avatar