1.

What is abstract method and abstract class?

Answer»

In PHP, an abstract class is ONE in which there is at least one abstract method. An abstract method is one that is DECLARED as a method but not implemented in the code as the same.

Example

abstract class PARENTCLASS {
  abstract public function someMethod1();
  abstract public function someMethod2($name, $COLOR);
  abstract public function someMethod3() : string;
}



Discussion

No Comment Found