Can one abstract class extend another abstract class and increase functionality

前端 未结 5 822
灰色年华
灰色年华 2021-02-01 03:15

I have an abstract class. I want to extend the abstract class by another abstract class and then implement the extended abstract class. Is it possible .If yes, whether it\'s a g

5条回答
  •  星月不相逢
    2021-02-01 03:40

    Yes, it is possible, and I don't see a reason not to use it if you need it (disclaimer: but however there are many ways to misuse this, and to over-complicate things, as with everything in programming usually).

    One thing to notice is that the second abstract class doesn't need to implement abstract methods from first class, but the first concrete must implement both.

提交回复
热议问题