When do we use interface extends interface

后端 未结 3 727
滥情空心
滥情空心 2021-01-13 12:10

I wish to know when we can use an interface extending another interface. I wish to know a practical example and when we use it.

3条回答
  •  醉梦人生
    2021-01-13 12:51

    1. When we want to use multiple inheritance in our application then one interface should extends other interface.

    2. To make the parallel development of your application it is very necessary to write your code in such a way that you can incorporate newly discovered requirements into the existing code as painlessly as possible. So, if we implements the interface then concrete class names locks you into specific implementations, making down-the-line changes unnecessarily difficult. Therefore, we extends interface.

提交回复
热议问题