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 class encapsulation?

586


What is a null tree?

628


#include #include #include #include void insert(char *items, int count); int main(void) { char s[255]; printf("Enter a string:"); gets(s); insert(s, strlen(s)); printf("The sorted string is: %s.\n", s); getch(); return 0; } void insert(char *items, int count) { register int a, b; char t; for(a=1; a < count; ++a) { t = items[a]; for(b=a-1; (b >= 0) && (t < items[b]); b--) items[b+1] = items[b]; items[b+1] = t; } } design an algorithm for Insertion Sort

2164


Get me a number puzzle game-program

1694


They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works?

1393






IS IT NECESSARY TO INITIALIZE VARIABLE? WHAT IF THE INSTANCE VARIABLE IS DECLARED final ? IS IT NECESSARY TO INITIALIZE THE final VARIABLE AT THE TIME OF THEIR DECLARATION?

1577


Why do we use class in oops?

553


any one please tell me the purpose of operator overloading

1965


What is cohesion in oop?

621


What is polymorphism programming?

601


What is oops with example?

562


What do you mean by abstraction?

609


What is the benefit of oop?

570


Is oop better than procedural?

570


What is object in oop with example?

697