More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know.
Ans. Java provides a faster allocation mechanism but at the cost of expensive deallocation. Deallocation in java is done by mechanism called garbage collection that runs periodically to free up unclaimed memory space , which actually slows down the application. Hence Java is usually faster if memory is not of concern and sufficiently large memory can be allocated to an application.
C/C++ on other hand have equal cost of allocation and de-allocation.
Help us improve. Please let us know the company, where you were asked this question :