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

Does improper inheritance have a potential to wreck a project?

742


Write a C++ Program to check whether a number is prime number or not?

723


Can user-defined object be declared as static data member of another class?

640


How does c++ structure differ from c++ class?

701


How can an improvement in the quality of software be done by try/catch/throw?

681






What is the latest c++ standard?

773


Does a derived class inherit or doesn't inherit?

717


. 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?

2879


When to use “const” reference arguments in a function?

682


What is virtual destructor? What is its use?

663


What is a list c++?

672


What are the data types in c++?

607


What is c++ prototype?

682


What is a sequence in c++?

661


Define anonymous class.

709