What is garbage collection in Java, and how can it be used ?

Answer Posted / janet

When an object is no longer referred to by any
variable,java automatically reclaims memory used by that
object.This is known as garbage collection.
System.gc() method may be used to call it explicitly.

Is This Answer Correct ?    180 Yes 34 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we overload run() method in java?

584


What is protected in java?

514


What are conditionals and its types?

573


What is the integer of 16?

530


Is an array a vector?

541






What is difference between next () and nextline () in java?

528


What state does a thread enter when it terminates its processing in java programming?

570


Is a case study a method or methodology?

454


What is e in java?

531


Is there any sort function in java?

567


How can constructor chaining be done using this keyword?

579


What differences exist between iterator and listiterator?

559


How we can declare a static variable?

642


Can we have two main methods in a java class?

528


Can constructor be synchronized?

527