What are the advantages of inheritance?
Answer Posted / axuu
Inheritance offers the following advantages --
Developement model closer to real life object model with
hierarchical relationships
Reusability -- facility to use public methods of base class
without rewriting the same
Extensibility -- extending the base class logic as per
business logic of the derived class
Data hiding -- base class can decide to keep some data
private so that it cannot be altered by the derived class
| Is This Answer Correct ? | 32 Yes | 8 No |
Post New Answer View All Answers
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
What are classes oop?
What is an example of genetic polymorphism?
What is property in oops?
What is encapsulation with example?
Why is abstraction used?
Why is object oriented programming so hard?
What is an interface in oop?
Where You Can Use Interface in your Project
What is abstraction oop?
#include
Explain the concepts involved in Object Oriented programming.
What is interface? When and where is it used?
Can main method override?
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?