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
Describe different states of a thread.
Why java strings are immutable in nature?
What is the equal sign?
What is tostring () method?
What are the types of exceptions?
What is xslt in java?
What is stringjoiner ?
What is immutable data?
How can a gui component handle its own events?
Why does it take so much time to access an applet having swing components the first time?
What is the basic concepts of OOPS?
how can you catch multiple exceptions in java?
How do you differentiate abstract class from interface?
Why is string builder not thread safe?
What restrictions are placed on method overloading?