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

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

    Well, this way you must implement List methods when you create a subclass to AbstractList, and you can also use an ArrayList as an AbstractList.

提交回复
热议问题