is interface are useful or not?

Posted by Subramanyame under Interview Questions on 12/23/2012 | Points: 10 | Views : 774 | Status : [Member] | Replies : 1
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?




Responses

Posted by: Pavanandey on: 12/24/2012 [Member] Bronze | Points: 25

Up
0
Down
http://forums.asp.net/t/1194489.aspx/1

Thanks
Pavan Kumar
Mark Answer if this fits the need

Subramanyame, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response