Interviews5 answers
Why to use “using” in C#?
5 Answers
Developer the desktop application
Yogesh SevankarPosted Oct 17, 2019, 10:34 PM EDT
The reason for the using statement is to ensure that the object is disposed as soon as it goes out of scope, and it doesn't require explicit code to ensure that this happens.
VikasPosted Mar 23, 2018, 4:20 AM EDT
for implementing IDisposabel interface
Mukesh KumarPosted Sep 3, 2017, 12:29 AM EDT
using keyword can use two places
1.) when adding a namespace
2.) dispose the object automatically when the class implement idisposable interface.
sushil kumarPosted Jul 20, 2017, 10:16 AM EDT
“Using” statement calls – “dispose” method internally, whenever any exception occurred in any method call and in “Using” statement objects are read only and cannot be reassignable or modifiable.
Vivek KumarPosted Feb 8, 2016, 8:18 AM EST



