O OneWordDaily
AI-generated image

destructor

/dɪˈstrʌktər/ noun · British & US
Valid in UK
Share WhatsApp

What does destructor mean?

noun

A destructor is a function or method that releases resources held by an object, such as memory or file handles, when the object is no longer needed. In programming, a destructor is typically used to clean up after an object's use.

Example

"The destructor was called to free the memory allocated by the object, preventing a memory leak."

Reviewed by Deb Chak, Editor. AI-assisted content curated by RJS Tech Solutions LLP.

Etymologically related

Synonyms for destructor

Antonyms of destructor

Rhymes with destructor