As Java programming has constructor that runs code when a new object is instantiated, I was curious if there was something to counter that. Creating new object occupies memory, so is there a mechanism in Java to erase or overwrite the unused memory?
If there a destructor in Java, then how does it differ from other memory management systems in programming languages such as C?