Java memory (Stack) allocation for local variables

前端 未结 3 1812
傲寒
傲寒 2020-12-05 05:25

I am learning java and right now i am stuck at memory allocation of object\'s and local variables. can any one illustrate or clear some of my doubts??

  1. I read
3条回答
  •  旧巷少年郎
    2020-12-05 05:45

    Ofcourse, java garbage collector always takes care of the Heap, when it gets a chance to be executed, so it only looks for orphan objects and wipes them out, that's why NEW keyword in java always creates new objects on the Heap memory.

提交回复
热议问题