class X
{
private:
int a;
protected:
X(){cout<<"X constructor was called"<<endl;}
~X(){cout<<"X destructor was called"<<endl}
};
Referring to the code above, which one of the following
statements regarding "X" is TRUE?
a) X is an abstract class.
b) Only subclasses of X may create X objects.
c) Instances of X cannot be created.
d) X objects can only be created using the default copy
constructor.
e) Only friends can create instances of X objects.
Answer Posted / shakti singh khinchi
Only subclasses of X may create X objects.
means (b) is the only answer.
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is the most useful programming language?
What is the default width for ouputting a long integer using the insertion operator?
Difference between declaration and definition of a variable.
What is flush programming?
If dog is a friend of boy and boy is a friend of house, is dog a friend of house?
Carry out conversion of one object of user-defined type to another?
What are register variables?
what is the use of void main() in C++ language?
How can a struct in c++ differs from a struct in c?
What is a stack c++?
Define 'std'.
What are the c++ access specifiers?
Explain the isa and hasa class relationships. How would you implement each?
What are vectors used for in c++?
What does override mean in c++?