What are the advantages of inheritance?

Answer Posted / k.kirankumar

1.reusability(that is we can use same code in different
versions(class etc..)
2.avoids tyoing of code again and again(code compatability)
3.cost(in sense their no need compile same code for many
number times regardless of its usage)
4.maintance is very because the in inheritance formart is
in the modules so that it is easy to find the errors in
the small module instead of finding errors in many no.of
lines at time
5.the bove feature will reduce testing effort.

Is This Answer Correct ?    11 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a function in oop?

717


What do you mean by variable?

668


What are the features of oop?

734


#include #include #include #include void insert(struct btreenode **, int); void inorder(struct btreenode *); struct btreenode { struct btreenode *leftchild; struct btreenode *rightchild; int data; }; main() { struct btreenode *bt; bt=(struct btreenode *)NULL; int req,i=1,num; clrscr(); printf("Enter number of nodes"); scanf("%d",&req); while(i<=req) { printf("Enter element"); scanf("%d",&num); insert(&bt,num); i++; } inorder(bt); } void insert(struct btreenode **sr, int num) { if(*sr==NULL) { *sr=(struct btreenode *)malloc (sizeof(struct btreenode)); (*sr)->leftchild=(struct btreenode *)NULL; (*sr)->rightchild=(struct btreenode *)NULL; (*sr)->data=num; return; } else { if(num < (*sr)->data) insert(&(*sr)->leftchild,num); else insert(&(*sr)->rightchild,num); } return; } void inorder(struct btreenode *sr) { if(sr!=(struct btreenode *)NULL) { inorder(sr->leftchild); printf("\n %d",sr->data); inorder(sr->rightchild); } else return; } please Modify the given program and add two methods for post order and pre order traversals.

3365


What is abstraction in oop?

726






What is polymorphism oop?

707


What is for loop and its syntax?

683


What is the full form of oops?

784


What is overloading and its types?

704


Can a destructor be called directly?

689


Why multiple inheritance is not possible?

683


What are the benefits of polymorphism?

718


write knight tour problem which is present in datastructure

2245


Why do we use polymorphism?

653


How do you explain polymorphism?

683