system.gc() 和 runtime.gc() 之间的区别 [英] Difference between system.gc() and runtime.gc()

查看:26
本文介绍了system.gc() 和 runtime.gc() 之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

System.gc()Runtime.gc()有什么区别?

推荐答案

两者都是一样的.System.gc() 实际上等同于 Runtime.gc().System.gc()内部调用Runtime.gc().

Both are same. System.gc() is effectively equivalent to Runtime.gc(). System.gc()internally calls Runtime.gc().

唯一的区别是 System.gc() 是一个类方法,而 Runtime.gc() 是一个实例方法.所以,System.gc()更方便.

The only difference is System.gc() is a class method where as Runtime.gc() is an instance method. So, System.gc() is more convenient.

这篇关于system.gc() 和 runtime.gc() 之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆