adspace


Why do we use the “using” statement?

Answer Posted / Akriti Porwal

The 'using' statement in C# is used for resource management, specifically to ensure that disposable objects are properly disposed of and released as soon as they are no longer needed. It automatically calls the Dispose() method on objects implementing IDisposable interface, which helps to avoid memory leaks.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write the .net syntax for 'while loop'?

1141