An Interface with Abstract Methods

前端 未结 2 488
眼角桃花
眼角桃花 2021-01-26 07:48

I came across some PHP code that was written by a co-worker (it was not used for anything). Basically it was an interface containing abstract methods. I then said that this was

2条回答
  •  一向
    一向 (楼主)
    2021-01-26 08:40

    All methods in an interface are abstract by definition.

    An abstract method is a method for which the prototype is supplied but not implemented. It forces subclasses to implement it, or be declared abstract.

提交回复
热议问题