What is the Advantage of Interface over the Inheritance in
OOPS?

Answer Posted / mms zubeir

1. Provides flexibility in implementing the operations for
the derived classes.

2. Avoid conflicts when more than one interfaces are
derived in a class.

I will club some more later...

Is This Answer Correct ?    28 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is oop useful?

699


what is the sylabus for priliminaries?

1799


What is Difeerence between List obj=new ArrayList(); and ArrayList obj=new ArrayList()?

2195


Which method cannot be overridden?

662


What are different types of JVM's? for example we use dalvik jvm for android then what about the remaining operating systems?

1752






#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.

3366


Can a varargs method be overloaded?

704


what's the basic's in dot net

1815


IS IT NECESSARY TO INITIALIZE VARIABLE? WHAT IF THE INSTANCE VARIABLE IS DECLARED final ? IS IT NECESSARY TO INITIALIZE THE final VARIABLE AT THE TIME OF THEIR DECLARATION?

1673


Write a program to implement OOPS concepts such as inheritance, polymorphism, friend function, operator overloading?

4345


How does polymorphism work?

737


Hi friends I have experience of 6 months in website design and maintanence. Now i am looking for other IT jobs.. to switch platform. please post any interview you know in chennai.

1877


What is an interface in oop?

675


What does I oop mean?

711


What is a class and object?

690