C# Interview Questions and Answers
<< Previous Question Next Question >>
 Question: 1794 Page Views: 

Explain using statement?



Posted By: Avi Date: 30 September 2009 07:12:51 AM
 Answer:

We create an object intance in a "using" statement to ensure that "Dispose" is called on the object when the "using" statement is exited. A "using" statement can be exited either when the end of the "using" statement is reached or if an exception is thrown and control leaves the statement block before the end of the statement.


Posted By: eTechPlanet


Date: 30 September 2009 07:12:51 AM
Post a better Answer if you have
 
(Will show your Gravatar icon)  
  Country flag

Loading
Enter the text as shown in the image EMBrf8
Related Questions
C# : How do you create a copy constructor?

How do you create a copy constructor?

public class Sample { Public Sample(Sample t) {/* copy constructor */}}
Category: C# Date: 10/13/2010 10:55:46 AM
C# : How do you unsubscribe from an event?

How do you unsubscribe from an event?

using -= operator
Category: C# Date: 10/13/2010 10:42:14 AM
C# : Does c# supports optional arguments?

Does c# supports optional arguments?

Yes, from version 4.0
Category: C# Date: 10/13/2010 10:03:47 AM
C# : How do you prevent property from being serialized?

How do you prevent property from being serialized?

by marking it with [NonSerialized()] attribute
Category: C# Date: 10/13/2010 9:10:46 AM
C# : What is meant by MulticastDeligate?

What is meant by MulticastDeligate?

MulticastDeligate is a special class.It is a deligate that can have more than one element in its inv....
Category: C# Date: 10/1/2010 11:54:31 AM