Computer Science, asked by raman4080, 1 year ago

static variable memory is shared common to all classes and methods loaded inside jvm ?


rohitkumarmandal18: mai kisi desh ke gaddar se nahi darta
rohitkumarmandal18: dobara pak ki side mat lena
rohitkumarmandal18: maine us Pakistani ko uske muh pe bola ki pak ka koae aukat nahi hai
rohitkumarmandal18: i hope u will understand
rohitkumarmandal18: and always support india
rohitkumarmandal18: bi

Answers

Answered by AKASHDIPDAS
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........!!!!!!!!
Answered by atharvkaushik1
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
Similar questions