In PHP OOP, an instance of an abstract class cannot be ______.
- created
- inherited
- accessed
- instantiated
An instance of an abstract class cannot be instantiated in PHP OOP. This is because an abstract class is incomplete and serves as a blueprint or template for other classes. Abstract classes can only be inherited by child classes, which must provide implementations for the abstract methods. Attempting to instantiate an abstract class directly will result in a runtime error. To utilize the functionality of an abstract class, you need to create an instance of a concrete child class that extends the abstract class. To know more, refer to: http://php.net/manual/en/language.oop5.abstract.php
Loading...
Related Quiz
- The fopen() function is used to open a file in PHP.
- What is the purpose of the file_exists() function in PHP?
- What is the purpose of the array_pop() function in PHP?
- How can you filter multiple inputs in PHP?
- You need to create a MySQL table, execute some queries, and then close the connection in your PHP script. How would you do this?