what is the use of finalize()Method
please explain with an example

Answer Posted / mrudang

Sometimes u have seen that some objects of java need to
perform an non- java resoures like file handler etc..

Now Suppose that object going to distroy.So java provides
the mechanism that some specific action will perform when u
delect or try to distory that object..

The opration that u want to perform when such kind of
object Distory is written in finalize method...

Is This Answer Correct ?    12 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can interface be private in java?

547


Is string is a data type?

573


What is a nonetype?

567


What is ph and buffers?

526


Which command from the jdk compiles a java program?

495






What are the 3 types of loops in java?

537


Does printwriter create a file?

546


What is javac_g?

594


Explain the key functions of data binding?

589


Why do we need array in java?

537


What is difference between null and void?

537


What are parsers? Dom vs sax parser.

563


What is meant by data hiding/encapsulation?

577


Difference difference paint() and paintcomponent()?

534


Mention some features of java?

546