What is an abstract class in PHP?

前端 未结 6 503
萌比男神i
萌比男神i 2020-11-30 18:08

What is an abstract class in PHP?

How can it be used?

6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-30 18:29

    An abstract class is like the normal class it contains variables it contains protected variables functions it contains constructor only one thing is different it contains abstract method.

    The abstract method means an empty method without definition so only one difference in abstract class we can not create an object of abstract class

    Abstract must contains the abstract method and those methods must be defined in its inheriting class.

提交回复
热议问题