What do you mean by multiple inheritance and multilevel
inheritance? Differentiate between them.
Answers were Sorted based on User's Feedback
Answer / ramya
multiple inheritance is the class derived from more than
one base class & where as coming to multilevel inheritance
it derives one class to one base class via intermediate
base class
Is This Answer Correct ? | 39 Yes | 13 No |
Answer / ravinder kumar
Multiple: ClassA--extends-->ClassB, ClassA--extends--
>ClassC, ClassA--extends-->ClassD class A can Inherit all
the classes and can have access on all calss' public
properties and functions.
MultiLevel: ClassA-->ClassB-->ClassC-->ClassD and ClassD
will have the accesss on all the properties of its upper
level class like C,B and A
Is This Answer Correct ? | 30 Yes | 14 No |
#include <stdio.h> #include <alloc.h> #include <stdlib.h> #include <conio.h> 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.
what are three tenets of object orinted Systems?Why they call like that ? Please answer me. Advance thanks.
all about pointers
what is the definition of incapsulation
What is the difference between an object and a class?
What is polymorphism used for?
why the memory allocated with new cant be freed using free()
Why is polymorphism needed?
write a program for function overloading?
14 Answers HCL, InfoCity, TATA,
in the following, A D B G E C F Each of the seven digits from 0,1,2,3,4,5,6,7,8,9 is: a)Represented by a different letter in abov fig: b)Positioned in the fig abov so tht A*B*C,B*G*E,D*E*F are equal. wch does g represents? C
What is destructor in oop?
wht is ditch