Grokking Java Interview Questions
0% completed
Stack, Heap, and Metaspace
void checkout() { int quantity = 10; Item item = new Item("apple", quantity); order.add(item); }
When this method returns, the variables quantity and item no longer exist. The Item object can remain in memory for hours, because the order still refers to it. The variables and the object are stored in different areas, and each area follows its own rules.
The lesson JDK, JRE, and JVM lists the memory areas of a JVM
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%