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 |
Why is c++ considered difficult?
what is meaning of isa and hsa
What is a namespace in c++?
How does c++ structure differ from c++ class?
What is object slicing and how can we prevent it?
What it is and how it might be called (2 methods).
What are the important differences between c++ and java?
What are the three forms of cin.get() and what are their differences?
Explain differences between alloc() and free()?
What is pointer with example?
if int1 has the value 12, int has the value 18, and int3 has the value 21, what is the result: int1 < int2 && int2 < int 3
What is endl c++?