What's the difference between
and
Enter two words to compare and contrast their definitions, origins, and synonyms to better understand how those words are related.

Constructor vs Destructor - What's the difference?

constructor | destructor |

In programming|lang=en terms the difference between constructor and destructor

is that constructor is (programming) a class method (in object-oriented programming) that creates and initializes each instance of an object while destructor is (programming) in object-oriented programming, the command sequence that is launched when the execution of an object is finished.

As nouns the difference between constructor and destructor

is that constructor is a person who, or thing that constructs while destructor is one who destructs.

constructor

English

Noun

(en noun)
  • A person who, or thing that constructs
  • (programming) A class method (in object-oriented programming) that creates and initializes each instance of an object
  • (motorsport) A company or individual who builds racing vehicles. In Formula One, ).
  • destructor

    English

    Noun

    (en noun)
  • One who destructs.
  • (programming) In object-oriented programming, the command sequence that is launched when the execution of an object is finished.