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 |
How do you show the declaration of a virtual constructor?
What is input operator in c++?
What is implicit pointer in c++?
How would you implement a substr() function that extracts a sub string from a given string?
What is the best c++ book?
print first nodd numbers in descending order
What are the types of container classes?
Write any small program that will compile in "C" but not in "C++"
What are the various compound assignment operators in c++?
what is data encapsulation in C++?
What is the hardest coding language to learn?
Why is it difficult to store linked list in an array?