Hey guys, we have 3 segments in our memory
1. Stack Segment
2. Heap Segment
3. Code Segment
Heap - contains all created objects in runtime, objects only plus their object attributes (instance variables)
Stack - contains local variables and Reference variables(variables that hold the address of an object in the heap)
Code - the segment where the actual compiled Java bytecodes resides when loaded
* Static members (variables or methods) are called class members, meaning they reside where the class(bytecode) resides, which is in the Code Segment.
ANSWER IS: Static members (variables or methods) reside in the Code Segment of the memory.
*Hope it'll clarify things