What is Finalizer in .NET define Dispose and Finalize ?



What is Finalizer in .NET define Dispose and Finalize ?..

Answer / Shikha Shukla

[n A finalizer, also known as a destructor in C++, is a method automatically called by the garbage collector when an object with a finalizer is about to be destroyed.nn The Dispose method is a user-defined method that releases resources such as file handles, network connections, or unmanaged memory before an object is garbage collected. It can be explicitly called by the user to free resources prematurely.nn Finalization and disposal are two different concepts: finalization is performed automatically by the garbage collector, while disposal should be called manually whenever possible for optimal performance.n]

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Dot Net General Interview Questions

What does cil do?

1 Answers  


What are Sessions?

2 Answers   Deloitte,


What is the purpose of delegates in .net?

2 Answers  


How do you handle Start, Pause, Continue and Stop calls from SCM within your application?

1 Answers  


What is the benefit of .net core?

1 Answers  


Define satelite assembly?

1 Answers  


Explain the process of compilation in .NET?

1 Answers  


How to spawn a thread?

1 Answers  


What is the difference between task and thread in .net?

1 Answers  


What property do you have to set to tell the grid which page to go to when using the Pager object?

2 Answers   Siebel,


What is the difference between the C#.NET and VB.NET?

6 Answers   MCN Solutions,


What is garbage collection in .net? Explain the garbage collection process?

1 Answers  


Categories