Job Interviews OOP Concept

Inheritance VS Polymorphism Top Programming Concept

Written by Techringe

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


Constructors are special class functions which performs initialization of every object


class Account {


float salary = 60000;


class Programmer: public Account {  public:

float bonus = 5000;     };       int main(void) {   Programmer p1;   cout<<“Salary: “<<p1.salary<<endl;     cout<<“Bonus: “<<p1.bonus<<endl;      return 0;



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


class Shape { protected: int width, height; public:

Shape( int a = 0, int b = 0) { width = a; height = b; } virtual int area()

{ cout << “Parent class area :”

<<endl; return 0; } };


About the author

Techringe 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