sometimes u will want to know how large the object heap is and how much of it is left.
-- totalMemory(), freeMemory().
finalize() : this method helps in garbage collection. A method that is invoked before an object is discarded by the garbage collector, allowing it to clean up its state.