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
How java is different from c and c++?
Explain the concept of memory leak?
If a base class declares a function to be virtual, and a derived class does not use the term virtual when overriding that class, is it still virtual when inherited by a third-generation class?
Define a pointer to a data member of the type pointer to pointer?
Carry out conversion of one object of user-defined type to another?
What is static function? Explain with an example
How can you create a virtual copy constructor?
How to get the current position of the file pointer?
What does floor mean in c++?
How can you tell what shell you are running on unix system?
What are the manipulators in c++?
Evaluate !(1&&1||1&&0) a) Error b) False c) True
What are the main features of c++?
What is the use of namespace std in C++?
What is the difference between *p++ and (*p)++ ?