Programming Essentials question 14

label Programming
account_circle Unassigned
schedule 1 Day
account_balance_wallet $5

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

Studypool's Notebank makes it easy to buy and sell old notes, study guides, reviews, etc.
Click to visit
The Notebank
...
Jul 22nd, 2015
...
Jul 22nd, 2015
Jun 24th, 2017
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