difine hierarchical inheritance.
Answers were Sorted based on User's Feedback
Answer / sujatha
hierarchical inheritance:
It is a type of inheritance where one or more derived
classes is derved from common( or one ) base class .
ex:
class A
{
// definition of class A
};
class B : public A //derived from A
{
// definition of class B
};
class C : public A //derived from A
{
// definition of class c
};
| Is This Answer Correct ? | 134 Yes | 22 No |
Answer / devi
Derivation of several classes from a single class i.e.,the
traits of one class may be inherited by more than one
class,is called hierarchical inheritance.
| Is This Answer Correct ? | 28 Yes | 4 No |
Answer / mohit karasanbhai kanani
hierarchical inheritance
Dedination:
One comman class have a two derived class.
Syntax:
class (classname)k /* base class */
{
/*defination of class k*/
};
class (classname)m:public class k /* derive class (here
derive class of class k)*/
{
/*defination of class m*/
};
class (classname)p:public class k /* derive class (here
derive class of class k)*/
{
/*defination of class p*/
};
void main
{
}
note: here class name k,p,m are only for example
| Is This Answer Correct ? | 23 Yes | 5 No |
Answer / mohit k kanani
Hierarchical Inheritance
class kar (base class)
{
}
class moh:public kar (derive class of kar and base class of
leo class)
{
}
class rip:public kar (derive class of kar and base class of
leo class
{
}
class leo:public moh,public rip (derive class of moh class
& rip class)
{
}
| Is This Answer Correct ? | 23 Yes | 8 No |
Answer / sivajothi
Hierarchical inheritance:
when many sub classes(Derived classes)inherit from a single base class is known as hierarchical inheritance.
| Is This Answer Correct ? | 6 Yes | 3 No |
Answer / manoj shukla
#include<constream.h>
#include<iostream.h>
class A
{
protected:
char name[20];
};
class B:public A
{
protected:
int age;
};
class C:public A
{
char adress[100];
void getdata()
{
cout<<"enter the name:-";
cin>>name;
cout<<"enter the age:-";
cin>>age;
cout<<"enter the adress:-";
cin>>adress;
}
void show()
{
cout<<"name"<<name<<"\n\n age"<<age<<"\n\nadress:-"<<adress;
getdata();
}
void main()
{
clrscr()
C K;
K.show();
getch();
}
| Is This Answer Correct ? | 5 Yes | 7 No |
Answer / aashi
#include<iostream.h>
class A
{
protected:
char name[20];
};
class B:public A
{
protected:
int age;
};
class C:public A
{
char adress[100];
void getdata()
{
cout<<"enter the name:-";
cin>>name;
cout<<"enter the age:-";
cin>>age;
cout<<"enter the adress:-";
cin>>adress;
}
void show()
{
cout<<"name"<<name<<"\n\n age"<<age<<"\n\nadress:-"<<adress;
getdata();
}
void main()
{
clrscr()
C K;
K.show();
getch();
}
| Is This Answer Correct ? | 2 Yes | 4 No |
Answer / muniba
hirerical means that is a tree like
for e.g
class A
{
//some data and methods
};
class B:class A
{
//some data and methods
};
class C:class B
{
//some data and methods
};
and hirerical inheritance is that inheritance which is a
tree like
grandfather
^
|
father
^
|
son
;)
| Is This Answer Correct ? | 38 Yes | 83 No |
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?
What are the different forms of polymorphism??
Write a program to implement OOPS concepts such as inheritance, polymorphism, friend function, operator overloading?
what is oops
What is deep and shalow copy?
What is the real time example of encapsulation?
given a set based questions and 5 questions based on it next data sufficiciency questions 2 and 2/3 english sentence completion with options very easy and 2 synononmys paragraph with 10 questions 10 minutes replace =,-,*,% with -,%,+,* type questions 5 3 questions lik following itssickhere itssickthere itssickhere istsickhere which is nt alike the others very easy
What is the difference between pass by value,pass by pointer,pass by reference in the catch block in the exception handling in c++
should we use linear search or binary search if elements are placed in random order or mixed?in both cases? i need a little bit detail ans?thnks
Is html an oop?
What does oop mean in snapchat?
What do we mean by a hidden argument in a function?