Is there any benefit in implementing a interface in a subclass even though the superclass implements the same interface

前端 未结 6 1484
醉酒成梦
醉酒成梦 2021-01-12 05:29

When I was seeing the declaration of ArrayList

class ArrayList extends AbstractList
    implements List, RandomAccess         


        
6条回答
  •  借酒劲吻你
    2021-01-12 05:41

    This is done for documentation purposes only, to make it immediately clear to the user of the class which interfaces the class implements.

    The redundant implements clause makes no difference to the compiler.

提交回复
热议问题