1.

For constructor overloading, each constructor must differ in ___________ and __________(a) Number of arguments and type of arguments(b) Number of arguments and return type(c) Return type and type of arguments(d) Return type and definitionThe question was asked during an interview.My enquiry is from Constructors in division Constructors and Destructors of Object Oriented Programming

Answer»

Right option is (a) Number of arguments and type of arguments

For EXPLANATION: Each CONSTRUCTOR must DIFFER in the number of arguments it accepts and the type of arguments. This actually defines the constructor signature. This helps to remove the AMBIGUITY and define a unique constructor as REQUIRED.



Discussion

No Comment Found

Related InterviewSolutions