Click here to Skip to main content
15,893,487 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
What is ihterface? why we use Interface? Can u explain with Real time example?
Posted

Similar question is already answered here
Why do we need interface in c#[^]
 
Share this answer
 
Comments
Abhinav S 28-Jun-12 1:39am    
5!
 
Share this answer
 
Comments
Abhinav S 28-Jun-12 1:33am    
More links. 5.
member60 28-Jun-12 7:18am    
thank you
go through this link -
When to use an Interface[^]
 
Share this answer
 
Comments
Abhinav S 28-Jun-12 1:33am    
Good link. 5.
 
Share this answer
 
Comments
Abhinav S 28-Jun-12 1:33am    
5!
uspatel 28-Jun-12 1:36am    
Thanks.......
Interfaces in C # provide a way to achieve runtime polymorphism. Interfaces in C# are provided as a replacement of multiple inheritance. Because C# does not support multiple inheritance, it was necessary to incorporate some other method so that the class can inherit the behavior of more than one class. Go through below links for more information:
Interfaces in C# (For Beginners)[^]
http://www.functionx.com/csharp1/examples/interface.htm[^]
http://www.codeguru.com/csharp/csharp/cs_syntax/interfaces/article.php/c7563/Interfaces-in-C.htm[^]
http://www.csharp-station.com/Tutorial/CSharp/lesson13[^]
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 28-Jun-12 1:39am    
Do you know non-runtime polymorphism? What is that? :-)
To unconfuse OP, I should explain that, historically, interfaces were introduced later then dynamic dispatch via virtual functions with override; and that mechanism was the only one used for polymorphism. Interfaces is another one, providing deeper abstraction (but requiring more development, in typical cases).
--SA
Vani Kulkarni 28-Jun-12 2:26am    
Well thanks SAK for enlightening me about non-runtime polymorphism. When OP has asked about Interfaces in C#, I assumed that he/she will be having knowledge about OOP concepts. Thank you again.
Sergey Alexandrovich Kryukov 29-Jun-12 18:29pm    
You are very welcome...
--SA
Abhinav S 28-Jun-12 1:39am    
5!
Vani Kulkarni 28-Jun-12 2:51am    
Thanks Abhinav :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900