Hi,
What is the use of interface? see below code
InterFace I1
{
Void M1();
}
Interface I2
{
void M2();
}
Public Class MyClass: I1,I2
{
M1()
{
Code Here
}
M2()
{
code here
}
}
So I am creating Object and fire these methods and works fine.
Now my question is, if i remove both the interfaces and create object for class and fires the methods, it will also works fine.
Then what is the Use of Interfaces?