package com.sudhirtheindian2.java123;
class A{
void input(){
System.out.println("enter your name");
}
}
class B extends A{
void display(){
System.out.println("my name is sudhir");
}
}
class C extends A{
void show(){
System.out.println("my name is abhi");
}
}
public class hirarchy {
public static void main(String[] args) {
B b = new B();
C c = new C();
b.input();
b.display();
c.input();
c.show();
// What is hierarchical inheritance in java ?
// A inheritance which contain
// only one super class & multiple sub class
// and all sub class directly extends super class
// called hierarchial inheritance
// super---> sub 1
// super---> sub 2
// super---> sub 3
// super---> sub 4
//
}
}
Computer Storage Units Converter Computer Storage Units Converter From: Bytes Kilobytes Megabytes Gigabytes Terabytes Value: To: Bytes Kilobytes Megabytes Gigabytes Terabytes Convert
टिप्पणियाँ
एक टिप्पणी भेजें