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

Answer Posted / ms

garbage collecton in java means, if a particular object in
a program is not being refered since long time then it will
be automatically deleted with the help of garbage collector
so that some amount of memory is saved.we can explicitily
call it by adding a method system.gc()in the program.so in
this case there is no need to use'destructor'to destroy the
objects.

Is This Answer Correct ?    69 Yes 17 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Are arrays dynamic in java?

530


Why pass by reference is not possible in java?

490


what is a green thread? : Java thread

567


What language is an assembler written in?

545


Which is a valid identifier?

538






Write a program to print count of empty strings in java 8?

534


If try block is successfully executed, Then Is Finally block executed?

603


What will be the default values of all the elements of an array defined as an instance variable?

544


Explain the importance of join() method in thread class?

636


Can we create a class inside a class in java?

540


What are the differences between graph and tree?

641


Is 0 true or false in java?

515


What is the functionability stubs and skeletons?

679


What access modifiers can be used for class ?

534


Why we use set in java?

508