hey,
why in C++ there is multi inheritance while in java there is only inheretance from one object?
what is the assumption that have been made for java?
With multiple inheritance, you run the risk of inheriting a base class twice. For example, say class B and C inherited from the base class A, and class D inherited both class B and C. Class D would have two copies of A's members. This can be avoid by using virtual inheritance, however. Java is safer when compared to C/C++.
ok thanks, one more question: depends on what u saying I understand that when the inheritance from interface there is no copy made ?
any reference will be helpful.
A Java interface has only method definitions and constant static data allowed
(so it is like a C++ abstract base class where all the methods are pure virtual)
This means there is no instance specific data at all.
The Java designers put these restrictions in so as to avoid the complexities of multiple inheritance