How is Garbage collection done in Java?

Answer Posted / boomiraj

Programmer can not cause the garbage collector.
We can call the garbage collection using System.gc();
And we can set the variable value equal to null, it assign that variable garbage rest the that use.

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is math an abstract class in java?

727


Can two objects have same hashcode?

747


What is arraylist class in java?

737


Define an applet in java?

842


Are the imports checked for validity at compile time? Will the code containing an import such as java.lang.abcd compile?

830


How do you define a set in java?

740


Explain differences between collection api and stream api?

848


How do you create a reference in java?

712


Can an interface extend another interface?

818


How many digits can a float hold?

754


How is treeset implemented in java?

739


What is string pool in java?

769


Is string is a data type?

749


What is java lang object?

749


What is final, finally, finalize?

803