Bird
0
0

Which statement about abstract methods in PHP is true?

easy📝 Conceptual Q2 of 15
PHP - Inheritance and Polymorphism
Which 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.
Step-by-Step Solution
Solution:
  1. Step 1: Recall abstract method rules

    Abstract methods declare a method signature without a body.
  2. Step 2: Implementation requirement

    Child classes must implement all abstract methods from the parent abstract class.
  3. Final Answer:

    Abstract methods must be implemented in child classes. -> Option B
  4. Quick 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 body
  • Believing abstract methods cannot be protected
  • Trying to call abstract methods directly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PHP Quizzes