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

前端 未结 6 1485
醉酒成梦
醉酒成梦 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:53

    There are no functional benefits to declaring them again, it does not affect the behavior in any way.

    I guess it's only added to make it clearer which interfaces are implemented.

提交回复
热议问题