Multiple Inheritance is nothing but one class extending morethan one class. Multiple Inheritance is basically not supported by many Object Oriented Programming languages such asJava, Small Talk, C# etc.. (C++ Supports Multiple Inheritance). As the Child class has to manage the dependency of more than one Parent class. But you can achieve multiple inheritance in Java using Interfaces.
Multiple inheritance in Java by interface
If a class implements multiple interfaces, or an interface extends multiple interfaces i.e. known as multiple inheritance.
Output:Hello Welcome
No comments:
Post a Comment