Java Cleanup is a interface that allows Java classes to be cleaned up after being garbage collected. It is ideal if you have tried finalize but it didn't work, or if you have read that finalize should not be used, or if you find PhantomReferences to be difficult to maintain.