What are constructor and destructor explain it with syntax?

Constructors are special class functions which performs initialization of every object . The Compiler calls the Constructor whenever an object is created. Constructors initialize values to object members after storage is allocated to the object. Whereas, Destructor on the other hand is used to destroy the class object.

Sizin İçin Seçtik  Are destructors always called?

Leave a Reply

Your email address will not be published. Required fields are marked *