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
Does improper inheritance have a potential to wreck a project?
Write a C++ Program to check whether a number is prime number or not?
Can user-defined object be declared as static data member of another class?
How does c++ structure differ from c++ class?
How can an improvement in the quality of software be done by try/catch/throw?
What is the latest c++ standard?
Does a derived class inherit or doesn't inherit?
. If employee B is the boss of A and C is the boss of B and D is the boss of C and E is the boss of D. Then write a program using the Database such that if an employee name is Asked to Display it also display his bosses with his name. For eg. If C is displayed it should also display D and E with C?
When to use “const” reference arguments in a function?
What is virtual destructor? What is its use?
What is a list c++?
What are the data types in c++?
What is c++ prototype?
What is a sequence in c++?
Define anonymous class.