C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
.NET
ADO.NET
Android
ASP.NET
C#
Databases & DBA
Design Patterns & Practices
iOS
Java
OOP/OOD
SharePoint
Software Testing
Web Development
WPF
View All
29
Reply
Why we use Interface ?
Sandeep Kumar
9y
4.1k
1
Reply
Delete Row
Delete Column
Insert Link
×
Insert
Cancel
Embed YouTube Video
×
Width (%)
Height (%)
Insert
Cancel
Table Options
×
Rows
Columns
First row as header
Create Table
Insert Image
×
Selected file:
Alignment
Left
Center
Right
Select an image from your device to upload
Upload to Server
Cancel
Submit
Interface basically used for Design Pattern. Interface can have Property,method,Events and Indexer.We can not define function body. and Implement derived class.Interface support multiple Inheritance.interface can not inherit class but class can inherit interface.
Arun Saini
9y
3
Interface is for ->create loosely coupled software ->support design by contract (an implementor must provide the entire interface) ->allow for pluggable software ->allow different objects to interact easily ->hide implementation details of classes from each other ->facilitate reuse of software
Rafnas T P
9y
3
Basically Interface flexibility of the code. it is used like a Design Pattern. And you can implement Method, Properties, etc. in it. you can used it for multiple Inheritance to increase reusability but can't create object of that Interface.
Kashif Asif
9y
1
One reason I use interfaces is because it increases the flexibility of the code
Munesh Sharma
9y
1
to make complex scenarios easier and code maintainability much easier. If you are a fan of SOLID principles then you will exactly know why interface rocks. :)
Vincent Maverick Durano
9y
1
The major reason of using an Interface is that when we want to enforce some standards. In programming words, the class which will implements the interface must provide implementation of all functions/methods of an Interface. So, standard is imposed.
Hammad Hassan
9y
1
it restrict/enforce us to specific design that these are the specific properties that object will contain
Ayyaz Ahmad
9y
1
for multiple inheritence
Mukesh Kumar
8y
0
for multiple inheritence
Mukesh Kumar
8y
0
for multiple inheritence
Mukesh Kumar
8y
0
for multiple inheritence
Mukesh Kumar
8y
0
for multiple inheritence
Mukesh Kumar
8y
0
for multiple inheritence
Mukesh Kumar
8y
0
for multiple inheritence
Mukesh Kumar
8y
0
for multiple inheritence
Mukesh Kumar
8y
0
To achieve multiple inheritance we using interface in c#
Manoj Kumar
8y
0
If we want to access the other class without the creation of object. It is a reusable component
Khaja Moizuddin
9y
0
Simple answers is that ASP.NET is OOPS based ... So Multiple Inheritance no longer supported Thats why we should use "Interface"
Manav Pandya
9y
0
Its work like as layer,same as a class. https://bikeshsrivastava.blogspot.in/2016/06/part-23what-is-interface-and-abstract.html
Bikesh Srivastava
9y
0
because using interface we can multiple inheritence
Hiren Parmar
9y
0
To achieve Loop coupling between module and achieve run time polymorphism.
Francis
9y
0
Interfaces are more flexible than base classes because you can define a single implementation that can implement multiple interfaces.
Keerthi Venkatesan
9y
0
http://dotnet-munesh.blogspot.in/2015/09/interface-in-c.html
Munesh Sharma
9y
0
to support multiple inheritance
Keerthi Venkatesan
9y
0
Interface is a component directive to implement all properties.A class that implements an interface must implement all of the methods described in the interface. So many things can support loosely coupled along with interface.
Maruthi Palllamalli
9y
0
Hide implementation, supports multiple inheritance and provide a agreement for all class that it inherit the interface that is "all class provide implementation of all functions/methods of an Interface"
Pankaj Kumar Choudhary
9y
0
to support multiple inheritance and to make loosely coupled software.
Akhil Garg
9y
0
Hide implementation, supports multiple inheritance
Anil Kumar Murmu
9y
0
We use interface for uncoupling the layer.
Sandeep Kumar
9y
0
What is default time for Session in ASP .NET?
What is syntax for implementing session ?
Message