How u call destructor and dispose methode in c#.NET
Answer / ruchika mathur
Destructor: They are special methods that contain the
cleanup code for the object.You cannot call them explicitly
as they are called by GC implicitly.
Class MyClass
{
~MyClass()
{
}
}
public interface IDisposable
{
void Dispose();
}
Class Test:IDisposable
{
protected void Dispose()
{
if(disposing)
{
// Code to dispose the managed resources of the class
}
// Code to dispose the un-managed resources of the class
isDisposed = true;
}
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
}
}
| Is This Answer Correct ? | 2 Yes | 2 No |
What is the difference between early binding and late binding in c#?
What to implement on my class Finalize or IDisposable
What happens in synchronisation?
How do you debug an ASP.NET Web application?
When should I use static in C#?
0 Answers SwanSoft Technologies,
Why do we use delegates?
What floating point types is supported in C#?
Why do we use public static void main in c#?
List the differences between method overriding and method overloading?
What's the difference between the debug class and trace class? Documentation looks the same.
may we achieve polyphormsm through overloading a funtion?Is it right or wrong concept because i read polyphormism can be achieved through overloading?plz help me thnks
What is difference between for and foreach loop in c#?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)