What are constructor and destructor explain with example?

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  İndikatör nedir ve nerelerde kullanılır?

Leave a Reply

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