-2

i want to inherit singly, circular & doubly linked lists in a parent class "list". Each class has its own interface.i first inherited singly, doubly & circular interface in a "list" interface then implemented that interface in my parent class "List".

please tell me the correct and good format how should i inherit three child classes in single parent class using java. Thank you.

1 Answers1

0

Well, I'm not sure that understood your final goal but saying briefly you have 3 opportunities:

  1. Your result class C inherits B and A which contain the methods needed (don't forget that in this case C should be logically a "type of B" and B should be a "type of A")
  2. You can use the Java 8 default methods in interfaces that will contain implementations of your methods

I hope this helps.

Anton Hlinisty
  • 1,441
  • 1
  • 20
  • 35