Question from the PHP7 test

Archived

What are the differences between abstract class and interface?

Author: Julien BreuxStatus: Archived(New question!)Question passed 677 times
-1
Community Evaluations
developer avatar
Umar
24/07/2022
You can define a private method in an abstract class. <?php abstract class A { abstract public function fn(); protected function fn2() { $this->fn3(); } private function fn3() { echo 'fn3'; } } class B extends A { public function fn() { echo 'fn'; } public function __construct() { $this->fn2(); } } new B();
developer avatar
Auteur anonyme
05/09/2022
Thank you Umar for the correction !