ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Microsoft Related  >>  C Sharp
 
 


 

 
 Visual Basic interview questions  Visual Basic Interview Questions
 C Sharp interview questions  C Sharp Interview Questions
 ASP.NET interview questions  ASP.NET Interview Questions
 VB.NET interview questions  VB.NET Interview Questions
 COM+ interview questions  COM+ Interview Questions
 ADO.NET interview questions  ADO.NET Interview Questions
 IIS interview questions  IIS Interview Questions
 MTS interview questions  MTS Interview Questions
 Crystal Reports interview questions  Crystal Reports Interview Questions
 BizTalk interview questions  BizTalk Interview Questions
 Dot Net interview questions  Dot Net Interview Questions
 Exchange Server interview questions  Exchange Server Interview Questions
 SharePoint interview questions  SharePoint Interview Questions
 Microsoft Related AllOther interview questions  Microsoft Related AllOther Interview Questions
Question
How u call destructor and dispose methode in c#.NET
 Question Submitted By :: K_arunpatro
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How u call destructor and dispose methode in c#.NET
Answer
# 1
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 ?    0 Yes 1 No
Ruchika Mathur
 

 
 
 
Other C Sharp Interview Questions
 
  Question Asked @ Answers
 
What?s the difference between an interface and abstract class? Mind-Tree4
What namespaces are necessary to create a localized application?  2
Where is the output of TextWriterTraceListener redirected?  1
Did a generic class can be inherited by a normal class? TCS1
how can i get this 123456789 1234 6789 123 789 12 89 1 9 Excel1
How can you overload a method?  2
What?s the difference between the System.Array.CopyTo() and System.Array.Clone()?  2
What is the difference between Abstract and Interface? HCL11
What are the the three types of DAO ?  1
an object,class is value type or refarance type. ? Synechron2
How u call destructor and dispose methode in c#.NET  1
What are Sealed Classes in C#?  12
Trace the O/p for a program on inheritance and Polymorphism. 3 classes A,B,C A with two methods public virtual SomeMethodA public virtual SomemoreMethodA B:A overide virtual SomeMethodA C:B new Method SomeMethodA override SomeMoreMethodA main method { b new instance of B b.SomeMethodA b.SomeMoreMethodA b1 new instance of C b1.SomeMethodA b1.SomeMoreMethodA }  1
How?s the DLL Hell problem solved in .NET? Visual-Soft1
How to run the program at particular time? It should run everyday at 3:00 PM. After executing the program should sleep until next day at 3:00 PM. Please explain with code? Wipro3
what is the real use of interface in c#,other than that multiple inheritance is not possible  3
What?s the advantage of using System.Text.StringBuilder over System.String?  1
what are the differences b/w structure and class?  8
why c# is pronounced as C-sharp instead of pronouncing it as C-hash? is there any technical reason behind it?  2
What?s the top .NET class that everything is derived from?  4
 
For more C Sharp Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com