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
We all know that a const variable needs to be initialized at the time of declaration. Then how come the program given below runs properly even when we have not initialized p?
Which sort does c++ use?
What do you mean by ‘void’ return type?
What is #include ctype h in c++?
Write about the scope resolution operator?
Describe private, protected and public – the differences and give examples.
What it is and how it might be called (2 methods).
What is problem with overriding functions?
Explain how would you handle a situation where you cannot call the destructor of a local explicitly?
What are the vectors in c++?
Explain binary search.
Explain about templates of C++.
What is a pointer with example?
Incase of a function declaration, what is extern means?
Describe exception handling concept with an example?