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
Differences between get and post methods?
What is php ci?
Do csrf tokens expire?
What type of operation is needed when passing values through a form or an url?
is that "enumerated array" equal to "numeric array"?
what is constructor
What is the array in php?
Is laravel frontend or backend?
iam mca post graduate in 2010 not getting job in JAVA so iam looking for carear in php as market demand is high so it is best option to try for php or not
How do you end php?
Define urlencode() and urldecode() used in php?
What is a php certification?
How to convert the first character to upper case?
Which is better python or php?
What is the function in PHP do not return a timestamp?