When will a constructor executed?

Answer Posted / preeti

Constructor execution is depend on its type like,

1) inbuilt or default construtor, no parameter constructor
are executes whenever object creates.

2) parameterized constructor execute whenever it calls.

3) base class constructor execute before than child class
constructor(child class is derived from base class
constructor).

Is This Answer Correct ?    21 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is cohesion in oop?

624


write knight tour problem which is present in datastructure

2168


Why do pointers exist?

663


How Do you Code Composition and Aggregation in C++ ?

24205


What is the use of oops?

623






Why is destructor used?

585


Write a c++ program to display pass and fail for three student using static member function

2818


Why is encapsulation used?

577


What is polymorphism what are the different types of polymorphism?

566


What is difference between abstraction and encapsulation?

594


Can we have inheritance without polymorphism?

617


When not to use object oriented programming?

572


What do you mean by overloading?

582


write a program using c++ to implement single contiguous memory mangement techniques.display the content of the main memory after yhe allocation of jobs and percentage of the wastage of the main memory

2763


What is the point of polymorphism?

590