+ 1
Where the static variable memory store's in Java...
I know it's in ram... but where the exactly JVM stores in memory allocated by OS to JVM...and how??
1 Antwort
+ 2
Class variables(Static variables) are stored as part of the Class object associated with that class. This Class object can only be created by JVM and is stored in permanent generation . Also some have answered that it is stored in non heap area which is called Method Area.
https://beginnersbook.com/2013/05/static-variable/
https://stackoverflow.com/questions/8387989/where-are-static-methods-and-static-variables-stored-in-java
https://betsol.com/2017/06/java-memory-management-for-java-virtual-machine-jvm/