Hi, everyone
C++ is my 1st language but I now I want to learn Java.
C++ accepts multiple inheritance.
Eg:
Class d
Protected class q(), class w()
{
}
But Java doesn't accept multiple inheritance.
Java use interfaces to contrivance multiple inheritance.
how to use interface to achieve multiple inheritance.
Thank you
Java multiple inheritance?
Re: Java multiple inheritance?
Have you used C++ to control our scopes, and are now looking to try and do the same with Java ?
Martyn
Technical Support Manager
Technical Support Manager
Re: Java multiple inheritance?
Multiple inheritance:
Code: Select all
public class Example {
public interface Animal {}
public interface FourLegs {}
public interface EightLegs {}
public class Insect {}
public abstract class Spider extends Insect implements Animal, EightLegs {}
public class Pegasus implements Animal, FourLegs {}
}