C#
‘using’ Declaration
› You can prefix "using" keyword before the local variable declaration,
What in order to call "Dispose" method when that variable goes out of
scope.
› New feature introduced in C# 8.0
Creating object
public void Method( )
How {
using ClassName referenceVariable = new ClassName( );
//do work here
} //Dispose will be called automatically here