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 the main feature of oop?

872


what is different between oops and c++

2164


What is the significance of classes in oop?

781


Is enum a class?

776


Why can't we have instance(stack) of a class as a member of the same class like eg.Class A{A obj;} as we can have self refential pointer

1878


What is encapsulation with real life example?

769


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

2301


Which type does string inherit from?

809


How do you answer polymorphism?

779


What is abstraction oop?

812


Explain the advantages of inheritance.

843


What is class in oop with example?

812


What is polymorphism used for?

756


When not to use object oriented programming?

753


What is overriding in oops?

804