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

write a program to insert an element into an array

26 Answers   TCS,


How will you call C functions from C ++ and vice-versa?

0 Answers   Agilent, Tavant Technologies, Thomson Reuters, Verifone,


What is problem with Runtime type identification?

2 Answers  


How can we access protected and private members of a class?

0 Answers  


Write a program using GUI concept for the scheduling algorithms in Operating system like SJF,FCFS etc..

0 Answers  






What operator is used to access a struct through a pointer a) >> b) -> c) *

0 Answers  


How do I open binary files?

1 Answers  


What is a responder chain?

0 Answers  


What does override mean in c++?

0 Answers  


How many keywords are used in c++?

0 Answers  


What is dangling pointers?and what is memory leak?

5 Answers  


Difference between pass by value and pass by reference?

0 Answers  


Categories