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

Answer Posted / pranab dutta

When a Java object becomes unreachable to the program, then
it is subjected to garbage collection. The main use of
garbage collection is to identify and discard objects that
are no longer needed by a program so that their resources
can be reclaimed and reused.

Is This Answer Correct ?    322 Yes 35 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What type of language is java?

539


How does regex work?

520


What is thread life cycle in java?

578


Does java set allow duplicates?

524


Can we override data members in java?

619






What is natural ordering in java?

520


What do you mean by chromounits in java8?

524


Is it possible for yielded thread to get chance for its execution again ?

547


Why to use nested classes in java? (Or) what is the purpose of nested class in java?

521


4.1 Supply contracts (in the form of comments specifying pre- and post conditions) for the enqueue() method of the LinkedQueue class given in the Appendix. (2) 4.2 Let Thing be a class which is capable of cloning objects, and consider the code fragment: Thing thing1 = new Thing(); //(1) Thing thing2 = thing1; //(2) Thing thing3 = (Thing) thing1.clone(); //(3) Explain how the objects thing2 and thing3 differ from each other after execution of the statements. (

1406


What is bool mean?

566


How do you classify Dialog Box?

645


What is sizeof () operator?

566


What is the function of compareto in java?

584


What is the static variable?

571