As of now ,what i know abt cloning is that we can make a field to field copy of an object.ie when we clone an object,its state as well as a its behaviour is copied to the cloned object.My question is what is the neccesity of it? cant we create another object of the same class? so how does its different from cloned object (that is creating another object of that class rather than being cloned).is there any security issues coupled with this cloned object? And What is the Concrete purpose of
Latest Answer : We need not call the finalize() method directly. The method is called automatically by the garbage collector when it determines no more references to the object exist. But when we need to clean-up non-Java resources ie closing a file, we need ...
Latest Answer : the object that has no reference is assumed to no longer used. so to reclaim its memory garbage collection is used. ...
Latest Answer : least priority thread ...
Latest Answer : The name "garbage collection" implies that objects that are no longer needed by the program are "garbage" and can be thrown away. ...
Latest Answer : exception object can be caught only once after it was caught i think it will be eligible for garbage collection. Not that it will be immediately destroyed but it will be destroyed soon if we are not using that object to detect what kind of exception it ...
The finalize() method will always be invoked once before the object is garbagecollected. However, the finalize() method might never be invoked for an object in itslifetime, because there is no guarantee that it will get garbage collected.Then what is the use of the finalize() method? Why should we use it?