Job Interviews OOP Concept

Constructor VS Destructor Top Programming Concept

Written by Techringe

List of Best Programming interviews Questions with Examples. Top OOP(Object Oriented Language) concepts with examples.Difference Between Constructor and Destructor.

Constructor

Constructors are special class functions which performs initialization of every object

Example

class A {

public:

int x; // constructor A()

{

// object initialization } };




Destructor

Destructor on the other hand is used to destroy the class object

Example

class X {

public: // Constructor for class X X();

// Destructor for class X ~X();

};

 

About the author

Techringe

techringe.com is Platform which offers Free download latest project source code in java, android, php, html, c# .net, c/c++, iphone, vb, python, jsp, asp .net, all programming lanugage.

Leave a Comment