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
From the two, which would be easier to write: synchronization code for ten threads or two threads?
What is parsing in grammar?
What are the access modifiers in java?
Is alive method in java?
What is the purpose of format function?
How does java enable high performance?
Is java hard to learn?
EDS (Electronic Data Systems India Pvt Ltd) at Chennai on 16-12-2006.
What is the benefit of inner / nested classes ?
Is array primitive data type in java?
What are variable names?
1.IN CASE OF DYNAMIC METHOD DISPATCH WHY WE USE REFERENCE VARIABLE,WE CAN USE THE DIFFERENT DEFINED OBJECT DIRECTLY TO ACCESS THE DATA MEMBER AND MEMBER FUNCTION OF THAT RESPECTIVE CLASS?WHAT IS THE MAIN FUNCTION OF "REFERENCE VARIABLE" HERE?
Explain the scope of a variable.
What is the common usage of serialization?
Which is better ascii or unicode?