static vs non static

后端 未结 4 1813
梦谈多话
梦谈多话 2020-12-19 04:21

Until few weeks back, I thought I understand when to make fields and methods static or non-static. For example, when a field (say object of another

4条回答
  •  鱼传尺愫
    2020-12-19 04:44

    Fields are not made static over garbage collection. That is whole new area to consider. If the memory is huge for your static field, yeah you should make it non-static.

提交回复
热议问题