Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention. Check out this how-to article for more information.
Java does not support destructors, but adds a finalize( ) method which are invoked by the garbage collector prior to reclaiming the memory hold by the object which has the finalize( ) method. you do not know when the objects are going to be finalized. Try Avoiding use of finalize( ) method to release non-memory resources like file handles, sockets, database connections because the platform has only a finite number of these resources, and you do not know when the garbage collection is going to invoked in to release these resources through the finalize( ) method.
C++ requires explicit memory management while Java has automatic garbage collection.
Join the community of 500,000 technology professionals and ask your questions.