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



class X { private: int a; protected: X(){cout<<"X constructor was called&qu..

Answer / guest

only subclasses of X may create X objects.
i.e and B

Is This Answer Correct ?    4 Yes 0 No

class X { private: int a; protected: X(){cout<<"X constructor was called&qu..

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

Post New Answer

More C++ General Interview Questions

Why is c++ considered difficult?

0 Answers  


what is meaning of isa and hsa

1 Answers  


What is a namespace in c++?

0 Answers  


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

0 Answers  


What is object slicing and how can we prevent it?

2 Answers   Tech Mahindra,






What it is and how it might be called (2 methods).

0 Answers  


What are the important differences between c++ and java?

0 Answers  


What are the three forms of cin.get() and what are their differences?

0 Answers  


Explain differences between alloc() and free()?

0 Answers  


What is pointer with example?

0 Answers  


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

3 Answers  


What is endl c++?

0 Answers  


Categories