|
|
|
|
|
by shemnon42
3202 days ago
|
|
Java does memory recovery strictly by garbage collection. To delete an object remove all references to that object and wait. A "delete now" operation imposes requirements on implementations that are not strictly required. Any advantages gained from destructors can be realized via explicit cleanup methods and (as a hedge against mis-use) state checking for initialized and destroyed objects. A delete operation also adds risk that an object that has been deleted may be referenced again (although with esoteric stuff like PhantomReferences you can almost do it). |
|