What is Finalizer?

 Posted by Tripati_tutu on 12/4/2010 | Category: C# Interview questions | Views: 2653 | Points: 40
Answer:

These are nothing but class-only methods which will execute before the garbage collector reclaims the memory for an unreferenced object. To implement finalizer, you have prefix the symbol(~) before the name of the class.

Syntax:
class Sample

{
~Sample()
{
…….
…….
}
}


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response