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
How arrays are stored in memory in java?
What are access specifiers in java ?
Why put method is used?
How to perform bubble sort in java?
Should database connections be singleton?
What will be the output of round(3.7) and ceil(3.7)?
How does remove work in java?
Why does java have two ways to create child threads?
What is regex java?
Write java program to reverse string without using api?
What is use of super keyword?
Why singleton pattern is better than creating singleton class with static instance?
What is the difference between interface & abstract class?
Can a constructor be made final?
What do you mean by object?