When will a constructor executed?

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write A Program to find the ambiguities in Multiple Inheritance? How are they resolved.(Virtual Functions)

3564


What is overloading in oops?

610


What does sksksk mean in text slang?

1547


What are different types of JVM's? for example we use dalvik jvm for android then what about the remaining operating systems?

1660


What is polymorphism and its types?

609






What is an example of genetic polymorphism?

658


Can bst contain duplicates?

682


What is inheritance in oop?

611


What is destructor give example?

612


What is polymorphism give a real life example?

572


How oops is better than procedural?

599


What is variable example?

601


What are the two different types of polymorphism?

679


What are constructors in oop?

605


How do you use inheritance in unity?

595