When will a constructor executed?

Answers were Sorted based on User's Feedback



When will a constructor executed?..

Answer / ssss

When ever object is created.

Is This Answer Correct ?    27 Yes 2 No

When will a constructor executed?..

Answer / 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

When will a constructor executed?..

Answer / rahul

When an object create means suddenly construtor get executed

Is This Answer Correct ?    22 Yes 3 No

When will a constructor executed?..

Answer / priya

Constructor gets called when we create an object,or when we
allocated memory using new operator:

void main()
{
test *t = new test;
delete t;
}

Is This Answer Correct ?    13 Yes 0 No

When will a constructor executed?..

Answer / poorna chandar rao

when ever object is created automatically (conncurently
)construcor also executed

Is This Answer Correct ?    6 Yes 1 No

Post New Answer

More OOPS Interview Questions

What is polymorphism and its types?

0 Answers  


What is a class oop?

0 Answers  


What is the differances between a abstract calss and interface

5 Answers   Aviva, Symphony,


What is the difference between a mixin and inheritance?

0 Answers  


Name an advantage of array over linked list?

24 Answers   GML, IBM, Software Solutions,






Where is pseudocode used?

0 Answers  


What is polymorphism what are the different types of polymorphism?

0 Answers  


why c++ is a highlevel language

3 Answers   Satyam, Tech Mahindra,


Why we use classes in oop?

0 Answers  


What is overriding in oops?

0 Answers  


What is design patterns in C++?

2 Answers   Persistent,


what is oops

4 Answers   NIIT,


Categories