So in Java I know that primitive values will be on the stack and that reference values for objects will be stored on the heap. Now will the variable, which is used as a storage location in memory, also be in the stack with that associated primitive value or be on the heap with the associated reference type value?
Asked
Active
Viewed 29 times
0
-
1Why not read for yourself: https://docs.oracle.com/javase/specs/jvms/se11/html/jvms-2.html#jvms-2.6 – Michael Jul 20 '20 at 19:44
-
@Michael which particular section are you referring to on that link, sorry? – manymen Jul 20 '20 at 19:48
-
I used anchor ref for the section, 2.6. – Michael Jul 20 '20 at 20:03
-
Does this answer your question? [static allocation in java - heap, stack and permanent generation](https://stackoverflow.com/questions/3849634/static-allocation-in-java-heap-stack-and-permanent-generation) – PumpkinSeed Jul 20 '20 at 20:37