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 |
What are the two types of polymorphism?
What is binary search in c++?
Program to check whether a word is a sub-string or not of a string typed
What is a vector c++?
Explain abstraction.
What is the basic structure of a c++ program?
How delete [] is different from delete?
What is the most common mistake on c++ and oo projects?
What is fixed in c++?
How can we check whether the contents of two structure variables are same or not?
What are different types of polymorphism supported by C++
Why can’t you call invariants() as the first line of your constructor?