All mock tests are FREE till 31 December — register to save your progress
Unit 3 · Programming Languages and Computer Graphics Paper 2 CS · December 2022 Shift 2

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

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: A. Date::Date(int dd) { /* ... */ }

Explanation

The keyword explicit appears only in the declaration inside the class; repeating it in an out-of-class definition is an error.

More Programming Languages and Computer Graphics questions