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 is null pointer and void pointer?
What is compilation?
Does c++ support multilevel and multiple inheritances?
Why use of template is better than a base class?
Is c++ vector a linked list?
What is the correct syntax for inheritance a) class aclass : public superclass b) class aclass inherit superclass c) class aclass <-superclass
What is Memory Alignment?
What is time_t c++?
Write a program using merge () function to combine the elements of array x[ ] and y[ ] into array z[ ].
Where do I find the current c or c++ standard documents?
What does int * mean in c++?
What are the advantages of early binding?