What does the 'new' keyword actually do in Java, and should I avoid creating new objects?

前端 未结 6 1322
盖世英雄少女心
盖世英雄少女心 2020-11-28 10:15

I signed up a few moments ago, though I\'ve been making great use of this site since I took up computer programming, which I\'ve been teaching myself and consider a little h

6条回答
  •  孤城傲影
    2020-11-28 11:03

    if you invoke 10 times, there will be 10 method frame in your java stack, each frame will act new() action and when frame finished, it will release.

    enter image description here

提交回复
热议问题