Aspire's Library

A Place for Latest Exam wise Questions, Videos, Previous Year Papers,
Study Stuff for MCA Examinations - NIMCET

Previous Year Question (PYQs)



If a constructor 'Date' is declared explicitly and has to be defined outside the class, which of the following is correct?





Solution

In C++, the keyword $\text{explicit}$ is used only while declaring the constructor inside the class.

When the constructor is defined outside the class, $\text{explicit}$ is not written again.

So, the correct definition is:

$ \text{Date::Date(int dd) { /* ... */ }} $



Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More


Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More

Ask Your Question or Put Your Review.

loading...