“I bought this guide a few days ago to prepare for my interview with Oracle. Many of the questions they asked me were from this guide. I found this book absolutely great!”
A class can only directly extend one class at a time. Multiple inheritance is only allowed with regard to interfaces. A class can implement many interfaces. But a class can only extend one non-interface class.
java supports single and multilevel inheritance.
a class can obtain some or all the properties of another class which is called the single inheritance.
suppose an inherited class is extended by another class then its said to be a multilevel inheritance.
the multiple inheritance is not viable in java but still the concept can be achieved through interface.
Java supports only single inheritance, although multiple inheritance can be achieved using interfaces…
A class can only directly extend one class at a time. Multiple inheritance is only allowed with regard to interfaces. A class can implement many interfaces. But a class can only extend one non-interface class.
java supports single and multilevel inheritance.
a class can obtain some or all the properties of another class which is called the single inheritance.
suppose an inherited class is extended by another class then its said to be a multilevel inheritance.
the multiple inheritance is not viable in java but still the concept can be achieved through interface.
java does not support inheritance instead of that it implents interface
Leave an Answer/Comment