Go Back   CP Web Hosting - reseller hosting > Server Scripting > .NET
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-13-2007, 12:08 PM
1R1 1R1 is offline
Senior Member
 
Join Date: Mar 2007
Posts: 164
Default Destructors

Is there anyone to tell me the main points about the destructors????????(in numbered form will be easy to understand).
Reply With Quote
  #2 (permalink)  
Old 07-13-2007, 12:12 PM
Senior Member
 
Join Date: May 2007
Posts: 151
Default Destructor

Well My Dear friend in C# you can never call destructor, the reason is one cannot destroy an object.It's the .Net frameworks Garbage Collector (GC) who has the control over the destructor in C#. GC destroys the objects only when necessary.
Regarding points these are
1. Destructors are invoked automatically, and cannot be invoked explicitly.
2. Destructors cannot be overloaded. Thus, a class can have, at most, one destructor.
3. Destructors are not inherited. Thus, a class has no destructors other than the one, which may be declared in it.
4. Destructors cannot be used with structs. They are only used with classes.
5. An instance becomes eligible for destruction when it is no longer possible for any code to use the instance.
6. Execution of the destructor for the instance may occur at any time after the instance becomes eligible for destruction.
7. When an instance is destructed, the destructors in its inheritance chain are called, in order, from most derived to least derived
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 08:31 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0