posts - 4237, comments - 3946, trackbacks - 370

Disclaimer

This was my personal weblog originally hosted by UgiDotNet, written mostly in Italian.

This blog is now part of my new site:
These postings are provided 'AS IS' with no warranties, and confer no rights. The views expressed on this weblog are mine alone and do not necessarily reflect the views of my employers.

Licenza Creative Commons

Tag Cloud

Archives

Post Categories

Ci sono ancora molti dubbi sui "distruttori" di C#, ovvero i finalizzatori...

Ecco i punti principali da ricordare, dove nella parola "destructors" dovete sempre considerare il finalizzatore:

  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.

Fonte: http://www.codeproject.com/csharp/csdest.asp

Print | posted on lunedì 27 novembre 2006 09:20 |

Comments have been closed on this topic.