Links

Categories

Tags


« | Main | »

Multiple inheritance, “mix-in classes”

By Jewe | January 12, 2015

interface I
{
    method M();
    method N();
}

class A implements I
{
    method A() {}
}

class B
{
    method B() {}
    method M() { println("Hello!"); }
}

class C
{
    method C() {}
    method N() { println("Goodbye!"); }
}

class D // Extend A and have B and C implement M() and N() for us!
    extends A
    inherits B, C
{
    method D()
        extends A()
        inherits B(), C()
    {
    }
}

Topics: code examples | Comments Off on Multiple inheritance, “mix-in classes”

Comments are closed.