adplus-dvertising
frame-decoration

Question

Which among the following can be used in place of default constructor?

a.

constructorName(int x,int y=0)

b.

constructorName(int x=0,int y=0)

c.

constructorName(int x=0,int y)

d.

constructorName(int x,int y)

Answer: (b).constructorName(int x=0,int y=0)

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Which among the following can be used in place of default constructor?

Similar Questions

Discover Related MCQs

Q. Can a class have more than one function with all the default arguments?

Q. Which is the correct syntax for using default arguments with the constructor?

Q. How many parameters must be passed if only the following prototype is given to a constructor?

Prototype: className(int x, int y, int z=0);

Q. If the constructors are overloaded by using the default arguments, which problem may arise?

Q. Which among the following is true ?

Q. Which constructor among the following will be called if a call is made like className(5,’a’);?

Q. Which constructor definition will produce a compile time error?

Q. If there is a constructor with all the default arguments and arguments are not passed then _________________

Q. Which is the correct statement for default constructors?

Q. Which is a good alternative instead of having one zero argument constructor and one single argument constructor with default argument?

Q. What is upcasting?

Q. Which among the following is true for upcasting in inheritance?

Q. Which among the following is safe?

Q. Which among the following is best situation to use upcasting?

Q. Which property is shown most when upcasting is used?

Q. Upcasting and downcasting objects is same as casting primitive types.

Q. If multiple inheritance is implemented, which upcasting will be correct?

Q. If class C inherits class B and class B inherits class A ________________

Q. Upcasting is _____________________ without an explicit type cast.

Q. Which concept is needed because of implicit type casting use?