1.

What Is Abstraction In Php?

Answer»
  • ABSTRACTION are defined using the keyword abstract .
  • PHP 5 introduces abstract classes and methods. Classes defined as abstract may not be INSTANTIATED (create object).
  • To extend the Abstract class, extends operator is used.
  • You can inherit only one abstract class at one time extending.
  • Any class that contains one abstract method must also be declare as abstract. Methods defined as abstract simply declare the method's SIGNATURE, they can't define the implementation.
  • All methods marked as abstract in the PARENT's class, declaration must be defined by the child.
  • additionally, these methods must be defined with the same (or a less restricted) visibility (PUBLIC,Protected & private).
  • Type hint & number of parameter must be match between parent & child class.



Discussion

No Comment Found