sandu sudhakar

Greenhorn
+ Follow
since Nov 17, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by sandu sudhakar

Ref: article
http://www.javaranch.com/journal/200409/Journal200409.jsp#a1

"String Literals are not eligible for garbage collection".

So in this example, none of the objects are eligible for garbage collection.
Answer: 0
Hi, Thanks for the response.

---------------------------------------------------------------------------
The main purpose of having a garbage collector is to free up space so that more memory is available for applications.. So the option is kinda obvious..
--------------------------------------------------------------------------

But garbage collector runs in high memory situations too..that's why I'm against choice A.

----------------------------------------------------------------------------please mention the link of this mock test or atleast the name of the mock test. Else it is very hard for us to check on that.
---------------------------------------------------------------------------
http://www.javacaps.com/scjp_mockexams1.html
Which of the following statements about garbage collection are true?

A) The garbage collector runs in low memory situations
B) You can run the garbage collector when ever you want.
C) When it runs, it releases the memory allocated by an object, which is no more in use.
D) Garbage collector immediately runs when you set the references to null.

I expect the answer to be C.
But given answer is A,C.
Not convinced about A. Garbage collector frees memory. But does it have something to do with low memory situation?