Example of Multiple Inheritance in JAVA

abstract class A
{
            {
            System.out.println("Abstract Class Object is Created");
            }
           
abstract void display();
}

interface T
{
int i=10;
void print();
}

class B extends A implements T
{

void display()
            {
            System.out.println("Display from Derived Class");
            }

public void print()
            {
            System.out.println("Interface Implementation");
            }

public static void main(String s[])
            {
            B b=new B();
            b.display();
            b.print();
            System.out.println(T.i);
            }

}

1 comment: