how exactly garbage collection take place?

Answer Posted / vijayakumar chinnasamy

Variable/object
1. is eligible for garbage collection when no object refers
to it.
2. Is eligible when its reference is set to null i.e
objName=null.
3. referred by method variables or local variables are
eligible for garbage collection when they go out of scope.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we override tostring method in java?

522


Is java owned by oracle?

516


What is a private class in java?

501


What is the difference between a vector & an array list?

666


Write a java program to count the number of words present in a string?

527






what is static import in java? Explain

545


Is it possible to specify multiple jndi names when deploying an ejb?

550


Why singleton pattern is better than creating singleton class with static instance?

528


What does the ‘static’ keyword mean? Is it possible to override private or static method in java?

555


Can I learn java without any programming experience?

543


How is a structure different from array ?

571


How to handle a web browser resize operation?

535


What is hashing in java?

556


Where is jre installed?

580


What is the difference between call by reference and call by pointer?

491