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


Please Help Members By Posting Answers For Below Questions

How java is different from c and c++?

635


Explain the concept of memory leak?

622


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?

605


Define a pointer to a data member of the type pointer to pointer?

570


Carry out conversion of one object of user-defined type to another?

605






What is static function? Explain with an example

557


How can you create a virtual copy constructor?

579


How to get the current position of the file pointer?

552


What does floor mean in c++?

578


How can you tell what shell you are running on unix system?

637


What are the manipulators in c++?

545


Evaluate !(1&&1||1&&0) a) Error b) False c) True

700


What are the main features of c++?

540


What is the use of namespace std in C++?

612


What is the difference between *p++ and (*p)++ ?

774