Which of the following statements are incorrect? default constructor is called at the time of declaration of the object if a constructor has not been defined. constructor can be parameterized. finalize() method is called when a object goes out of scope and is no longer needed. finalize() method must be declared protected?
Answers
Answered by
1
the wrong statement is finalize() method must be protected.. i think so
Answered by
0
Answer incorrect statement is Finalize () method called when a objects goes out of scope and is no longer need
Explanation:
And correct statement default is a constructor is called at the time of declaration of an object. Finalize method is called just prior to garbage collection . It is not called when object goes out of scope. That can be at any time after it has become eligible for garbage collection. Finalize method is called twice because the memory heap becomes eligible for garbage cleaning two twice. Finalize method is used to perform cleanup operations on unmanaged resources held by the current object before the object is destroyed.
Similar questions