what is interface in php? how it is use?
Answer Posted / jadhav yeshwanth
An Interface is like a template similar to abstract class
with a difference where it uses only abstract methods.
In simple words, an interface is like a class using
interface keyword and contains only function
declarations(function with no body).
An Interface should be implemented in the class and all the
methods or functions should be overwridden in this class.
for eg:
interface InterfaceName{
function fun1();
function fun2(a,b);
}
class ClassName implements InterfaceName{
fuction fun1(){
function implementation.......
}
fuction fun2(a,b){
function implementation.......
}
}
Is This Answer Correct ? | 125 Yes | 19 No |
Post New Answer View All Answers
How to get number of elements in an array?
How to remove an empty directory?
What is the value for this auto incremented field user_pri_id?
Explain a resource?
What is the current stable version of php? What advance thing in php7?
Why do we show php code in browser?
How to write comment in php?
How to concatenate two strings together in php?
Which of the data type is compound datatype supported by PHP?
How to move uploaded files to permanent directory?
Suppose your zend engine supports the mode Then how can you configure your php zend engine to support Mode ?
What is regular expression in php?
What is zend studio for?
What are the advantages of php mysql?
What is the use of curl()?