Destructor (computer Programming) - Destructor Syntax

Destructor Syntax

  • C++ has the naming convention in which destructors have the same name as the class of which they are associated with, but prefixed with a tilde (~).
  • In Object Pascal, destructors have the keyword "destructor" and can have user-defined names (but are mostly called "Destroy").
  • In Perl, the destructor method is named DESTROY.
  • In Moose object system for Perl, the destructor method is named DEMOLISH.
  • In Objective-C, the destructor method is named "dealloc".
  • In PHP 5, the destructor method is named "__destruct". There were no destructors in previous versions of PHP.

Read more about this topic:  Destructor (computer Programming)