class A {
public:
void f();
protected:
A() {}
A(const A&){}
};
Examine the class declaration shown above. Why are the
default and copy constructors declared as protected?
1. To ensure that A cannot be created via new by a more
derived class
2. To ensure that A cannot be copied
3. To ensure that A cannot be used as a base class except
when public inheritance has been used
4. To ensure that A cannot be created/copied outside the
inheritance chain
5. To ensure that A cannot be instantiated as a static variable
Answer Posted / prasenjit roy
4. To ensure that A cannot be created/copied outside the
inheritance chain
| Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
What are references in c++?
Does c++ have string data type?
What is c strings syntax?
What is data structure in c++?
What is data types c++?
What are dynamic type checking?
What is the standard template library (stl)?
Why should you learn c++?
What do you mean by persistent and non persistent objects?
Write a recursive program to calculate factorial in c++.
Write a Program for read a line from file from location N1 to N2 using command line arguments. Eg:exe 10 20 a.c
Is multimap sorted c++?
What is c++ used for in games?
Is swift a good first language?
Do you know about C++ 11 standard?