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 |
How do you define a class in c++?
Can turbo c++ run c program?
What is private inheritance?
Write a single instruction that will find the remainder of integral division when x is divided by y. Have the answer stored in z.
How can we access protected and private members of a class?
tell me about yourself ?i want answer for frehers with various exasmples?
What will happen if I allocate memory using "new" and free it using "free" or allocate sing "calloc" and free it using "delete"?
What is a local reference?
What is the difference between a copy constructor and an overloaded assignment operator?
4 Answers Belzabar, Citrix, Microsoft, Wipro,
How the programmer of a class should decide whether to declare member function or a friend function?
Write a program which uses Command Line Arguments
What is static class data?