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
What is php's mysqli extension?
Does php have future?
How to create a session? How to set a value in session?
How can we destroy the cookie in php?
How To Get the Uploaded File Information in the Receiving Script?
Tell me what is the importance of "action" attribute in a html form?
What is the meaning of php?
Which is better #define or enum?
What is cookies php?
List some array functions in php?
How can you increase the maximum execution time of a script in php?
How to break a file path name into parts?
What does odbc do in context with php?
What is use of header() function in php?
What is default session time and path in PHP. How to change it?