What is close method? How its different from finalize and dispose?



What is close method? How its different from finalize and dispose?..

Answer / Deepshikh Singh

The Close method is used to release resources associated with a stream or connection. It is called explicitly by the application when it no longer needs the resource. Finalize is a method that is called automatically by the garbage collector when an object is about to be destroyed. Dispose, on the other hand, is a method that should be called manually by the application to release resources as soon as possible. The Close method and Dispose method are often used together in .NET to properly clean up resources.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Dot Net General Interview Questions

What is "common language specification" (cls) in .net?

1 Answers  


Explain me what are the deferred execution and the immediate execution in linq?

1 Answers  


How to produce an assembly?

1 Answers  


What are use of Cloud computing....?

1 Answers   CTS,


What is the single responsibility principle?

1 Answers  


How is development of a Windows service different from a Windows Forms application?

1 Answers  


Why did they call it .net?

1 Answers  


What is DTS and explain the purpose of it?

1 Answers   ADITI,


Explain how to stop a thread?

1 Answers  


What are two different types of remote object creation mode in .net?

1 Answers  


What is RPC? What is the use of it?

1 Answers   Accenture,


Explain weg config settings for exception managment in asp.net?

1 Answers   C Squared Systems,


Categories