Rob Prime wrote:
Deepika Srivastava wrote:
Shruthi Sam wrote:Hi,
I know java doesn't support multiple inheritance directly and through the interface we can achieve multiple inheritance in java. And we know that all the classes extends the Object class by default. So if we are having a class say x. Let us assume that x extends another class say y. In this scenario x extends y and Object . Is that right? if that is the case is that not a multiple inheritance? Please clarify.
heelloooo
What is the meaning of this post? Is it a kick? If so, 14 minutes is much, much too early to warrant it. http://faq.javaranch.com/java/PatienceIsAVirtue
Hello Shruthi,
In this scenario, the class X extends the class Object i.e. it is the root of the class hierarchy and every class has Object as a superclass. Here, the class Y extends the class Oject. However, the class X is not extending both classes i.e. class Y and class Object at a same time, the class Object is the superclass of the class X but it is not the direct superclass of X. Hence it is not multiple inheritance.