In what cases will class A have at most one constructor, taking into account the constructors automatically generated by the compiler? (code using this class may be arbitrary).
Explanation
The compiler can automatically generate two constructors - the default constructor and the copy constructor. The default constructor is only generated if there are no explicitly declared constructors in this class. A copy constructor is generated if there is an explicit declaration of this constructor. Therefore, a class can have exactly one constructor only if the copy constructor is explicitly declared.

Слідкуй за CodeGalaxy

Мобільний додаток Beta

Get it on Google Play
Зворотній Зв’язок
Cosmo
Зареєструйся Зараз
або Підпишись на майбутні тести