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
Is map ordered c++?
How is static data member similar to a global variable?
What is a NULL Macro? What is the difference between a NULL Pointer and a NULL Macro?
What is the difference between containment and delegation?
Difference between class and structure.
What is the difference between structures and unions?
What are the advantages of using pointers in a program?
Write about the members that a derived class can add?
Why c++ does not have finally?
What are the classes in c++?
What is operator overloading in c++ example?
Explain one method to process an entire string as one unit?
What is oop in c++?
What is a breakpoint?
Is turbo c++ free?