当前位置: 技术问答>java相关
SCJP题 about Garbage Collection
来源: 互联网 发布时间:2015-03-15
本文导语: 5. Which is true? A. Calling System.gc() causes garbage collection to occur, but the time for the process to complete is unspecified. B. Calling Runtime.gc() causes garbage collection to occur, but the time for the process to complete is unspecified. ...
5. Which is true?
A. Calling System.gc() causes garbage collection to occur, but the time for the process to complete is unspecified.
B. Calling Runtime.gc() causes garbage collection to occur, but the time for the process to complete is unspecified.
C. Memory leaks are impossible in Java.
D. Memory is used more efficiently in Java.
E. Memroy corruption due to double use of memory is impossible in Java.
真火,题目看不太明白,特别是CDE选项.
请帮忙解释一下.
A. Calling System.gc() causes garbage collection to occur, but the time for the process to complete is unspecified.
B. Calling Runtime.gc() causes garbage collection to occur, but the time for the process to complete is unspecified.
C. Memory leaks are impossible in Java.
D. Memory is used more efficiently in Java.
E. Memroy corruption due to double use of memory is impossible in Java.
真火,题目看不太明白,特别是CDE选项.
请帮忙解释一下.
|
C. 在java中内存泄漏是不可能的
D. java中内存得到更加有效的利用
E. 由于同一内存块被多次引用而导致错误在java中是不可能的
D. java中内存得到更加有效的利用
E. 由于同一内存块被多次引用而导致错误在java中是不可能的
|
1) when gc finishes, the process is done
2) System.gc is the same as Runtime.gc
3) If you creates objects and put them into a list but never delete those objects, memory leak still happens.
4) Java is easy to write, but never be efficient. Because Java don't delete objects, so it is not efficient
5) because you don't delete, so memory will not be corrupted.
2) System.gc is the same as Runtime.gc
3) If you creates objects and put them into a list but never delete those objects, memory leak still happens.
4) Java is easy to write, but never be efficient. Because Java don't delete objects, so it is not efficient
5) because you don't delete, so memory will not be corrupted.