Why interface is used?



Why interface is used?..

Answer / Shweta Verma

Interfaces are used in C# for several reasons, including promoting loose coupling between classes by defining a contract that the implementing classes must adhere to; providing a way to achieve polymorphism and multiple inheritance (a class can implement multiple interfaces); organizing code by dividing the implementation details from the interface; and enabling programmers to work with abstractions rather than concrete classes.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More OOPS Interview Questions

Which is the parameter that is added to every non-static member function when it is called?

3 Answers   Accenture,


What causes polymorphism?

1 Answers  


write a program to find 2^n+1 ?

1 Answers   CTS,


What is the difference between and interface and an abstract class ?

4 Answers   IBM, Infosys, Ness Technologies,


What are virtual classes?

0 Answers  


What is polymorphism oop?

1 Answers  


What is the main difference between C++ and Java

11 Answers   TCS,


what is overloading

3 Answers   MindCracker,


ambiguity regulation of multiple inheritance with example.

1 Answers  


write a code for this. serial_number contained in the header of the file will be read , if this serial number is less than a previous serial number within a successfully processed file, or is the same as another serial number within a successfully processed file, or if the field contains anything other than 7 digits, then the file must error with the reason ‘Invalid SERIAL_NUMBER’.

1 Answers   Microsoft, TCS,


difference between class and object

10 Answers   Chandan, IBM, Magic Soft,


What is the difference between an object and a class?

3 Answers  


Categories