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.
Answers were Sorted based on User's Feedback
Answer / guest
only subclasses of X may create X objects.
i.e and B
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / 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 |
Show the declaration for a static member variable.
What is a smart pointer?
What is the use of volatile variable?
What is c++ best used for?
What does asterisk mean in c++?
What is size of Empty Class?
Is vector a class in c++?
What is the advantage of an external iterator.
Describe private, protected and public?
what is Member Functions in Classes?
Which software is best for programming?
What are namespaces in c++?