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

后端 未结 4 1894
梦谈多话
梦谈多话 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:37

    If you use the interface also as a marker. Class.getInterfaces(); will only return directly instanced interfaces.

提交回复
热议问题