java.lang.Object

The java class automatically extends Object.so, if we extends some other class, our class gets both classes functionality.So, it is multiple inheritence.Can anyone clear how the runtime handles this one?RegardsE Panneer Selvam
[268 byte] By [panneerselvambe] at [2007-9-30 19:16:32]
# 1

Nope, this is not multiple inheritance, this is plain single inheritance as each class can inherit from one super class that itself can inherit from a super class and so on. The subclass does not get both classes functionality as some other class can overwrite functionlity of the Object class (or some other super class). There can only be one method with the same name and the same parameters.

Multiple inheritance is when a class inherits from 2 or more classes ( extends SClass1, SClass2

) but this is not supported by Java as it results in many dificulties. E.g. what if both classes have methods with the exact same name and parameters? which one to use?

In brief: Java just supports single inheritance. Read about inheritance:http://java.sun.com/docs/books/tutorial/java/concepts/inheritance.html

MartinHilpert at 2007-7-6 23:28:46 > top of Java-index,Administration Tools,Sun Connection...