Interface in PHP

Interface in PHP

Interface in PHP

 

An Interface does not contain any functionality, it only specify set of methods which classes must implement.

You can create interface in php oop by using interface keyword.

An Interface is like a template similar to abstract class but there are little bit differences where you can use only abstract methods

You can implement your interface in classes by using implements keyword.

You will have to notice that when you are going to implement interface in your class then method should be define with public accessibility.

If you will use other than public visibility then it will generate error.

When should you use interfaces? What are they good for?

Interface are a good way to implement reusability. you can define interface for a number of condition, you can then implement your interface in different ways.

Problem of multiple inheritance can be resolved by using interface.

Note :  While defining method in your interface, do not use abstract keyword in your methods.
                

Phone: (+91) 8800417876
Noida, 201301
ataşehir escort maltepe escort bostancı escort kadıköy escort maltepe escort ataşehir escort kurtköy escort kartal escort pendik escort ataşehir escort
şişli escort
pendik escort
izmir escort izmir escort izmir escort izmir escort denizli escort antalya escort antalya escort antalya escort izmir escort izmir escort izmir escort izmir escort izmir escort