For Java, objects referred to by static fields will reside on the heap like other objects:
The heap is the runtime data area from which memory for all class instances and arrays is allocated.
The field will be initialised (if the declaration contains an initialization) when the class is loaded, which happens immediately before the first occurrence of any one of the following:
- an instance of the class is created.
- a static method declared by the class is invoked.
- a static field declared by the class is assigned.
- a static field declared by the class is used and the field is not a constant variable (§4.12.4).
The access to the static field is done via 2 special JVM instructions, getstatic and putstatic. But apart from that distinction, static fields are similar to non static fields.