Java interfaces… Dynamic or static memory?

后端 未结 3 1411
北恋
北恋 2021-01-19 15:10

Where do java interfaces reside in memory? Do they reside in the heap or the stack, or maybe global memory? I am thinking the are in the stack since they are created at comp

3条回答
  •  温柔的废话
    2021-01-19 15:48

    Interfaces are technically not "instantiated" in the sense that a regular class instance is created, but class information is stored in the java permgen space. See http://blogs.oracle.com/jonthecollector/entry/presenting_the_permanent_generation for more information on the permgen and the difference between a class instance and class information.

提交回复
热议问题