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
Write a program in c++ to print the numbers from n to n2 except 5 and its multiples
Is empty stack c++?
How do you sort a sort function in c++ to sort in descending order?
Difference between pointer to constant vs. Pointer constant
What is runtime errors c++?
What is vector string in c++?
What are punctuators in c++?
Differentiate between a copy constructor and an overloaded assignment operator.
What is virtual destructor ans explain its use?
Why cstdlib is used in c++?
In a function declaration what does extern means?
How do you invoke a base member function from a derived class in which you’ve overridden that function?
What is c++ used for in games?
Can malloc be used in c++?
How do you compile the source code with your compiler?