Programming Essentials question 14

Programming
Tutor: None Selected Time limit: 1 Day

You can write as many constructors for a class as you want, as long as they all have different ____ lists.
A.
B.
C.
D.
Jul 22nd, 2015

Thank you for the opportunity to help you with your question!

-------------------------------------------------------------------------------------------------------------

You can write as many constructors for a class as you want, as long as they all have different parameter lists.


For example, the class Fraction below has two constructors that have different parameter lists.

class Fraction

{

private:

intm_nNumerator;

intm_nDenominator;

public:

Fraction()// default constructor

{

  m_nNumerator=0;

m_nDenominator=1;

}

// Constructor with parameters

Fraction(int nNumerator, intn Denominator=1)

{

assert(nDenominator!=0);

m_nNumerator=nNumerator;

m_nDenominator=nDenominator;

} };



ANSWER:  D. Parameter

-------------------------------------------------------------------------------------------------------------

SOURCE: http://www.learncpp.com/cpp-tutorial/85-constructors/

Please let me know if you need any clarification. I'm always happy to answer your questions.
Jul 22nd, 2015

Did you know? You can earn $20 for every friend you invite to Studypool!
Click here to
Refer a Friend
...
Jul 22nd, 2015
...
Jul 22nd, 2015
Dec 3rd, 2016
check_circle
Mark as Final Answer
check_circle
Unmark as Final Answer
check_circle
Final Answer

Secure Information

Content will be erased after question is completed.

check_circle
Final Answer