1.

What is the difference between abstract class and interface in php?

Answer»

Many differences occur between the interface and abstract class in php.

  • Abstract methods can declare with protected, public, private. But in case of Interface methods STATED with the public.
  • Abstract CLASSES can have method stubs, constants, members, and defined processes, but interfaces can only have constants and methods stubs.
  • Abstract classes do not support multiple INHERITANCE but interface support this.
  • Abstract classes can contain constructors, but the interface does not support constructors.

Note: Our PHP logical questions has been created by seasoned PHP experts. It shall help you to ANSWER some of the most frequently ASKED questions during a job interview.



Discussion

No Comment Found