PHP - Inheritance and PolymorphismWhich statement about abstract methods in PHP is true?AAbstract methods must have a body in the abstract class.BAbstract methods must be implemented in child classes.CAbstract methods cannot be declared as protected.DAbstract methods can be called directly without implementation.Check Answer
Step-by-Step SolutionSolution:Step 1: Recall abstract method rulesAbstract methods declare a method signature without a body.Step 2: Implementation requirementChild classes must implement all abstract methods from the parent abstract class.Final Answer:Abstract methods must be implemented in child classes. -> Option BQuick Check:Abstract methods implementation = Required in child [OK]Quick Trick: Abstract methods have no body and require child implementation [OK]Common Mistakes:Thinking abstract methods have a bodyBelieving abstract methods cannot be protectedTrying to call abstract methods directly
Master "Inheritance and Polymorphism" in PHP9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More PHP Quizzes Array Functions - Array unique and flip - Quiz 1easy Error and Exception Handling - Custom exception classes - Quiz 7medium File Handling - File open modes - Quiz 5medium File Handling - Writing files (fwrite, file_put_contents) - Quiz 9hard Inheritance and Polymorphism - Type hinting with parent classes - Quiz 8hard Inheritance and Polymorphism - Type hinting with parent classes - Quiz 2easy Interfaces and Traits - Multiple trait usage - Quiz 3easy Sessions and Cookies - Destroying sessions - Quiz 13medium String Functions - String comparison functions - Quiz 6medium String Functions - String search functions (strpos, strstr) - Quiz 8hard