package com.sudhirtheindian2.java123;
//class A{
// void show(){
// System.out.println("this is class A");
// }
//
//}
//class B{
// void show(){
// System.out.println("this is class B");
// }
//}
interface A{
void show(); // public+abstract
}
interface B{
void display(); // public+abstract
}
public class Multiple implements A,B {
public void show(){
System.out.println("this is interface of a and b");
}
public void display(){
System.out.println("this is display");
}
public static void main(String[] args) {
Multiple m1 = new Multiple();
m1.show();
m1.display();
}
// Multiple inheritance in java ?
// Multiple inheritance using interface
// we can achieve multiple inheritance through interface
// because interface contains only abstract method
// which implementation is provided by the sub classes
// interface contains only abstract method
// example--->>>
// class C extends A,B; wrong
//
// class C implements A,B right
}
Computer Storage Units Converter Computer Storage Units Converter From: Bytes Kilobytes Megabytes Gigabytes Terabytes Value: To: Bytes Kilobytes Megabytes Gigabytes Terabytes Convert
टिप्पणियाँ
एक टिप्पणी भेजें