I am an absolute beginner in Java but hava a fairly good C++ background. Is this statement true? If so, please explain. 'Java supports multiple inheritence indirectly through interfaces'. Regards, Vidyut
Hi Vidyut! Yes java supports multiple inheritence indirectly through interfaces. The basic idea of multiple inheritence is to implement the properties of the base class.Here in java we do it through interfaces with the help of "implements" keyword. Hope u find this information useful. Regards Preethi
Hi , Comparing with C++, Java facilitates using features of multiple classes in a child class with interfaces. Interfaces are the one which have "What to do...." in them but not "how to do..." This might give you a start in understanding interfaces in Java
What I am trying to understand, is how technically correct is that statement. Meaning, do interfaces in Java map the 'Multiple Inheritance' concept literally? Let me try to explain more clearly in terms of the actual definition of 'Multiple Inheritance'..... Multiple Inheritance, as I understand, is the ability of a language to allow 'Subclassing' and 'Subtyping'. Subclassing, is basically allowing child classes to 'use' methods and possibly variables from another class. The implementation is unimportant, as long as the user may reuse code. Sybtyping is the ability for a data type (usually a class) to derive its type from another data type. C++ provides both these. Java provides 'Subtyping' through 'interfaces', but NOT the 'Subclassing', so would one say that Java allows 'Multiple Inheritance'? To me the more correct statement would be, that 'Java provides for multiple inheritance, only partly through interfaces'. Sorry to be so nit-pickity on the definitions, but I though this was essential, since none of the answers I got were of much help. I was and am not asking anyone to explain interfaces, its the concept of multiple inheritance in Java that I was wishing an explanation for. I do hope, someone can give me a more satisfying answer to this question Regards, Vidyut