Let's say we have a scenario like, a class 'A' is extended by two classes 'B' and 'C'.
Now, class 'D' extends class 'B' and want's to access class 'C'.
Here, we'll get an error here or we'll not allowed to do so.
Now, my query is, whenever 'D' wants to extend 'C', it must check whether 'B' and 'C' are having same base class or not.
If 'B' and 'C' are not derived from same base class, then 'D' must allowed to extend two classes at a time.
Henry Wong wrote:
Just do a search for multiple inheritance. This question has been asked many times.
I know why we can't extend. But the thing is can Developers who developed java design it in such a way, that ,
Class 'D' can allowed to extend more than one classes, provided the classes which it going to extend should not share a same