Where are static class variables stored in memory?

前端 未结 3 1650
再見小時候
再見小時候 2021-01-02 02:38

This is a follow-up question to How are static arrays stored in Java memory? .

So global variables in C/C++ are stored in the static data segment of memory. But what

3条回答
  •  独厮守ぢ
    2021-01-02 03:05

    Java has a "permanent" heap where it puts class metadata. So the "roots" of the static values are in the permanent heap. The values are reference values (class objects) the values themselves are in the regular heap.

提交回复
热议问题