§1.1.4 四
Which of the following statements are true?
Mutiple: 1) The automatic garbage collection of the JVM prevents programs from ever running out of memory
//JVM的垃圾自动回收机制可以阻止程序用完内存。(对啊,为什么不选呢??)
2) A program can suggest that garbage collection be performed but not force it3) Garbage collection is platform independent
//垃圾回收是平台独立的(???我自己这样翻译也感觉不通,但我却也不知道这句英文到底哪错了呢??谢谢)
4) An object becomes eligible for garbage collection when all references denoting it are set to null.24
答案错了吧,我觉得都对啊?请帮忙解释一下可以吗?小弟感激流涕。。
Which of the following statements are true?
Mutiple: 1) The automatic garbage collection of the JVM prevents programs from ever running out of memory
//JVM的垃圾自动回收机制可以阻止程序用完内存。(对啊,为什么不选呢??)
2) A program can suggest that garbage collection be performed but not force it3) Garbage collection is platform independent
//垃圾回收是平台独立的(???我自己这样翻译也感觉不通,但我却也不知道这句英文到底哪错了呢??谢谢)
4) An object becomes eligible for garbage collection when all references denoting it are set to null.24
答案错了吧,我觉得都对啊?请帮忙解释一下可以吗?小弟感激流涕。。
解决方案 »
- 求mvc框架 资源。。。。。。。。。。
- Mysql odbc 驱动安装问题
- java 与 C 数据结构的主要区别
- 一个包的问题
- 没有jdk无法验证,不知道(i+'a')==(i+97)对不对?
- 又一新java QQ群等着大家的加入!请附消息 java
- 菜鸟问题:怎样实现键盘事件?(外一则)
- 一个java IO 问题。。。 大家来看看。
- socket连接问题
- ★blue999star(正在学习的星星)、yeli(旗手) 来拿分啊! 谢谢!
- 在installanyanywhere中能运行并安装MsSql2000吗?
- 请问这个hashCode方面为什么要用7 11 13 乘上这些值? 不乘不可以吗? 为什么要多此一举呢?
垃圾回收机制只是提供了一种保障,但是并不能阻止。垃圾回收时,只回收没有内存中没有利用的空间。如果所有的资源都是可用的,垃圾回收器就不会回收这些资源。同时内存也有可能被暂完。
如:一个内存比较小的机子上运行这样一个东东:
String[] strs=new String[Integer.maxLength];
for(String s:strs)
{
s="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa无限多个";
}
你认为能够搞定这个东西吗?
题目的意思是 平台是JVM?如果是这样的话就想得通了,是吗?