Java Developers
Group for Java developers and programmers. Ask questions and get answers related to Java programming
263 Members
Join this group to post and comment.
Divya Singh
Divya Singh
Computer Science
14 Jan 2019

What is the difference in garbage collection methods in java and C++?

C/C++ does not facilitate automatic garbage collection and delete Or free()  is used to explicitly deallocate memory and call the destructor. While in java this task is done automatically using the garbage collector time to time which runs a scan and removes those variables from memory which have not been used in a long time. 

Any improvements to this answer are welcome.