How would you stop a class from class from being derived or
inherited.
Answer Posted / vishaka
The class shoul be made abstract to stop it from being
derived or inherited. To make a class abstract, it should
have atleast one pure virtual function.
| Is This Answer Correct ? | 2 Yes | 21 No |
Post New Answer View All Answers
They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works?
Which is better struts or spring?
Why is polymorphism used?
What is difference between multiple inheritance and multilevel inheritance?
What is the main purpose of inheritance law?
What are two types of polymorphism?
What is the highest level of cohesion?
Why is abstraction needed?
How is polymorphism achieved?
What are the benefits of interface?
What is object-oriented programming? Webopedia definition
#include
Which method cannot be overridden?
class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash
Can a varargs method be overloaded?