Question: Which constructor will be called from the object here2 in the below class X ( int a; X() ( a=0; X(int b) { }

Which constructor will be called from the object here2 in the below class X ( int a; X() ( a=0; X(int b) { } 

Which constructor will be called from the object here2 in the below class X ( int a; X() ( a=0; X(int b) { } a=b+1; } X(int c, int b) { a=b+c; }; x here1(20); x here2 (40,50); X here3; x(int c, int b) X(int c) X(int b) Complie time error.

Step by Step Solution

3.41 Rating (151 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

In the image we see a class X with three constructors defined 1 A ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!