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 session in c#?
Is php dying 2018?
What is the role of the .htaccess file in php?
What is different between software and app
What are regular expressions in programming?
What is the use of htmlentities in php?
How can MYSQL functions be available with PHP?
Define soundex()?
What is the best php version for wordpress?
What is session and why do we use it?
Explain me what is the meaning of a persistent cookie?
How can you associate a variable with a session?
What is the difference between implode() and explode() in php?
What is the purpose of the '.frm' file extension? What do thes file contain?
Is php is dying?