Multiple Inheritance Example Program in Java

By | December 17, 2010
Multiple Inheritance Example Program in Java. You can find multiple inheritance example program (code snippets) in this page.

Multiple Inheritance Example Program in Java. You can find multiple inheritance example program (code snippets) in this page.

interface First{
void disp();
}
interface Second extends First{
void show();
}
abstract class Shape1{
abstract void draw();
}
class Rectangle1 extends Shape1 implements First{
public void draw(){
System.out.println(“Inside draw”);
}
public void disp(){
System.out.println(“inside disp”);
}
}
class MultipleInheritanceDemo{
public static void main(String args[]){
Shape1 shape=new Rectangle1();
shape.draw();
}
}
Result:
Inside draw

Leave a Reply

Your email address will not be published. Required fields are marked *