How can you create a constructor with three default


Question: How can you create a constructor with three default parameters two of type string and one double?

Also when you create an object with the default parameters?

Does this work for C++?

E(std::string x ="name", std:: string y ="hello", double z = 0);

Implementation

E(string x ="name", string y ="hello", double z = 0)

{

firstName = x;

last = y;

money = z;

}

Object

E e;

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: How can you create a constructor with three default
Reference No:- TGS0962021

Expected delivery within 24 Hours