A PHP class implements an interface using the implements keyword.

  • TRUE
  • FALSE
  • nan
  • nan
A PHP class does indeed implement an interface using the implements keyword. This keyword is placed after the class name and is followed by the name of the interface or a comma-separated list of interface names. By implementing an interface, a class agrees to fulfill the contract defined by the interface. The class must provide an implementation for all the methods defined in the interface. Multiple interfaces can be implemented by listing them after the implements keyword. This allows the class to define behavior and functionality according to multiple contracts. To know more about interface implementation, visit: http://php.net/manual/en/language.oop5.interfaces.php
Add your answer
Loading...

Leave a comment

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