static variable memory is shared common to all classes and methods loaded inside jvm ?
rohitkumarmandal18:
mai kisi desh ke gaddar se nahi darta
Answers
Answered by
0
Yes, because it shares global data and functions to all classes and methods() loaded inside Java Virtual Machine (JVM).
IF YOU LIKE MY ANSWER, PLEASE MARK ME AS BRAINLIEST MATE...............!!!!!!!!
FOLLOW ME FOR MORE SOLUTIONS OF YOUR DOUBTS..........!!!!!!!!
BE BRAINLY........!!!!!!!!
IF YOU LIKE MY ANSWER, PLEASE MARK ME AS BRAINLIEST MATE...............!!!!!!!!
FOLLOW ME FOR MORE SOLUTIONS OF YOUR DOUBTS..........!!!!!!!!
BE BRAINLY........!!!!!!!!
Answered by
0
Hey friend
Answer for your question is
Static methods (in fact all methods) as well as static variables are stored in the PermGen section of the heap, since they are part of the reflection data (class related data, not instance related).
Update for clarification:
Note that only the variables and their technical values (primitives or references) are stored in PermGen space.
If your static variable is a reference to an object that object itself is stored in the normal sections of the heap (young/old generation or survivor space). Those objects (unless they are interal objects like classes etc.) are not stored in PermGen space.
Hope it helps
Please mark it as brainliest
ATHARV KAUSHIK
Answer for your question is
Static methods (in fact all methods) as well as static variables are stored in the PermGen section of the heap, since they are part of the reflection data (class related data, not instance related).
Update for clarification:
Note that only the variables and their technical values (primitives or references) are stored in PermGen space.
If your static variable is a reference to an object that object itself is stored in the normal sections of the heap (young/old generation or survivor space). Those objects (unless they are interal objects like classes etc.) are not stored in PermGen space.
Hope it helps
Please mark it as brainliest
ATHARV KAUSHIK
Similar questions
Science,
7 months ago
Physics,
7 months ago
Sociology,
7 months ago
Computer Science,
1 year ago
Social Sciences,
1 year ago
History,
1 year ago
Math,
1 year ago