Interviews24 answers
Why we use Interface ?
24 Answers
interface is agrrement between itself and implmenetd clas
in C# Multiple inheritance is not supoorted so we use interfaces
rahul shindePosted Feb 27, 2024, 4:52 AM EST
I use for speed purpouses, the JIT Compiler compile just one time if you are using several classes with the same interface.
Jefferson S. MottaPosted Jul 25, 2018, 9:02 AM EDT
for multiple inheritence
Mukesh KumarPosted Sep 3, 2017, 12:34 AM EDT
To achieve multiple inheritance we using interface in c#
Manoj Kumar DuraisamyPosted Jan 2, 2017, 8:43 PM EST
If we want to access the other class without the creation of object.
It is a reusable component
Khaja MoizuddinPosted Dec 2, 2016, 4:32 AM EST
Simple answers is that
ASP.NET is OOPS based ...
So Multiple Inheritance no longer supported
Thats why we should use "Interface"
Manav PandyaPosted Sep 20, 2016, 6:09 AM EDT
Its work like as layer,same as a class.
https://bikeshsrivastava.blogspot.in/2016/06/part-23what-is-interface-and-abstract.html
Bikesh SrivastavaPosted Sep 20, 2016, 6:00 AM EDT
because using interface we can multiple inheritence
Hiren ParmarPosted Aug 13, 2016, 10:28 PM EDT
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 AsifPosted Aug 7, 2016, 1:13 AM EDT
To achieve Loop coupling between module and achieve run time polymorphism.
Francis SusaimichaelPosted Aug 6, 2016, 6:13 AM EDT
One reason I use interfaces is because it increases the flexibility of the code
Munesh SharmaPosted May 30, 2016, 8:37 PM EDT
Interfaces are more flexible than base classes because you can define a single implementation that can implement multiple interfaces.
Keerthi VenkatesanPosted May 12, 2016, 11:40 PM EDT
http://dotnet-munesh.blogspot.in/2015/09/interface-in-c.html
Munesh SharmaPosted May 9, 2016, 8:44 AM EDT
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 DuranoPosted Apr 12, 2016, 4:34 AM EDT
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 SainiPosted Apr 12, 2016, 1:45 AM EDT
to support multiple inheritance
Keerthi VenkatesanPosted Apr 11, 2016, 5:52 AM EDT
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 PalllamalliPosted Mar 9, 2016, 1:47 AM EST
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 ChoudharyPosted Feb 21, 2016, 3:07 PM EST
to support multiple inheritance and to make loosely coupled software.
Akhil GargPosted Jan 31, 2016, 2:26 AM EST
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 HassanPosted Jan 18, 2016, 9:12 AM EST
it restrict/enforce us to specific design that these are the specific properties that object will contain
Ayyaz AhmadPosted Jan 17, 2016, 8:02 AM EST
Hide implementation, supports multiple inheritance
Anil Kumar MurmuPosted Jan 12, 2016, 2:43 AM EST
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 PPosted Jan 10, 2016, 11:50 PM EST
We use interface for uncoupling the layer.
Sandeep KumarPosted Jan 9, 2016, 5:39 AM EST



















