For using of understanding

using Chinese meaning is usage, use. I.e., "use";

using the following syntax, i.e. the interval in a subject, freed outer segment (only borrow possesses not also used i.e., leaves no Zhanshen)

In a nutshell: using using object will be automatically released after using it.

using (<ClassName> <VariableName> = new <ClassName>())
{
...
}

The same function, and without the use of using wording

Option One: using using

using (myclass my = new myclass())
{
my .Operate(numberA, NumberB);
}

Option Two: Without using

myclass my = new myclass();

my .Operate(numberA, NumberB);

my .Dispose();

 

Guess you like

Origin www.cnblogs.com/pjyu/p/10956522.html