Explain about finalize method?



Explain about finalize method?..

Answer / Vikash Utpal

A finalizer in C# is a virtual method that's called by the CLR when an object is being garbage collected. Finalizers are used to clean up unmanaged resources (e.g., file handles, database connections) before the object is destroyed.nFor example:n```csharpnpublic class MyClass {n ~MyClass() {n Console.WriteLine("Finalizer called for MyClass");n }n}n```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

Is 0 an unsigned integer?

1 Answers  


Describe ado.net?

1 Answers  


What is a base class in C#?

1 Answers   TryTechnicals Pvt Ltd,


You have got 1 million parking slots. At a time a parking slot can be free or not. To get next slot easily which data structure to implement?

1 Answers  


Why are dynamic link library used over static one?

1 Answers   C DAC,


What?s an abstract class?

5 Answers   Siebel,


What exactly is serverless?

1 Answers  


What is string [] args in c#?

1 Answers  


Where’s global assembly cache located on the system?

1 Answers  


Why we use methods in c#?

1 Answers  


Hello! How to do this: "Create manifest utility intended for creating update content files. Application should take a set of files as input parameter and generate XML based manifest file as output one." I use C# and vs.net 2003. It's urgent! Help please, thanks. Mayana

1 Answers  


What does type safety mean?

1 Answers  


Categories