Using Statement usage in C#

Answer Posted / nipun

The using statement allows the programmer to specify when objects that use resources should release them. The object provided to the using statement must implement the IDisposable interface. This interface provides the Dispose method, which should release the object's resources.
e.g.
using (Font font1 = new Font("Arial", 10.0f))
{
}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a page life cycle?

784


I’m having some trouble with cas. How can I diagnose my problem?

785


What is cached data phone?

744


What is routing in MVC?

792


List the events in page life cycle.

721


Is there any alternative to avoid name collisions other then Namespaces?

804


how to retrieve property settings from xml .config file.

719


What is s2s tracking?

727


What is the difference between file-based dependency and key-based dependency?

780


How does the service stream content?

763


What is content page in asp net?

689


Just by seeing the signature of the bean how can you specify whether it is a stateful or stateless session bean?

732


Explain swagger components.

746


Explain about solution explorer window?

792


Explain some of the major built-in objects in asp.net

785