When will a constructor executed?
Answers were Sorted based on User's Feedback
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 |
Answer / rahul
When an object create means suddenly construtor get executed
| Is This Answer Correct ? | 22 Yes | 3 No |
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 |
Answer / poorna chandar rao
when ever object is created automatically (conncurently
)construcor also executed
| Is This Answer Correct ? | 6 Yes | 1 No |
We have a scale and 7 balls. 1 ball is heavier than all the rest. How to determine the heaviest ball with only 3 possible weighing attempts?
OOP'S advantages of inheritance include:
What is polymorphism what are the different types of polymorphism?
What is object-oriented programming? Webopedia definition
Why is object oriented programming so hard?
Write a macro for swapping integers
What is difference between data abstraction and encapsulation?
What are the benefits of polymorphism?
What is variable example?
What is conditional Compilation?
What is Difeerence between List obj=new ArrayList(); and ArrayList obj=new ArrayList()?
What is polymorphism and example?