You are writing a PHP script and you need to define an abstract class. How would you do this?

  • abstract class ClassName
  • final class ClassName
  • static class ClassName
  • var class ClassName
To define an abstract class in PHP, you can use the abstract keyword followed by the class keyword and the name of the class. For example: abstract class ClassName {} The abstract keyword indicates that the class is intended to be an abstract class. Abstract classes cannot be instantiated directly and are meant to be extended by other classes. They can contain abstract methods (without implementation) and non-abstract methods (with implementation). Refer to: http://php.net/manual/en/language.oop5.abstract.php
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *