+ 3
What is multiple interface in java? And when do we use it?
2 Answers
+ 1
In general, anĀ interfaceĀ is a device or a system that unrelated entities use to interact. ... Unlike a class, anĀ interfaceĀ never implements methods; instead, classes that implement theĀ interfaceĀ implement the methods defined by theĀ interface. A class can implementĀ multiple interfaces..
we are used Most peopleĀ use multiple-inheritanceĀ in the context of applyingĀ multipleĀ interfaces to a class. This is the approach Java and C#, among others, enforce. C++ allows you toĀ apply multipleĀ base classes fairly freely, in an is-a relationship between types. So, you can treat a derived object like any of its base classes.