Why would both a parent and child class implement the same interface?

后端 未结 4 1908
梦谈多话
梦谈多话 2020-11-28 09:45

I inherited some legacy Java (1.4) code and this design decision appears regularly. I can\'t understand if there\'s any purpose or reason to it.

public inter         


        
4条回答
  •  悲&欢浪女
    2020-11-28 10:21

    I actually find that design pointless. Implemented interfaces, as you stated, are just inherited, so there's no need to copy and paste "implements SomeInterface" on the children classes. It's not clearer, smarter, or whatsoever...

提交回复
热议问题