what is the real use of interface in c#,other than that
multiple inheritance is not possible
Answer Posted / pugal
When creating a standalone project which can be
changed at will, use an interface in preference to an
abstract class; because, it offers more design flexibility.
Use an interface to design a polymorphic hierarchy
for value types.
Use an interface when an immutable contract is
really intended.
A well-designed interface defines a very specific
range of functionality. Split up interfaces that contain
unrelated functionality.
| Is This Answer Correct ? | 48 Yes | 14 No |
Post New Answer View All Answers
Can a struct inherit from another struct or class in c#?
How do I run managed code in a process?
To create a localized application which namespaces are necessary?
Why cannot you specify the accessibility modifier for methods inside the interface?
What is a .exe extension files? How is it similar to .dll extension files?
What is mvc pattern in c#?
What does the initial catalog parameter define in the connection string?
Is null empty or whitespace c#?
Is datetime nullable c#?
Can a sealed class be used as a base class?
What is a multicast c# delegate?
What do you know about Translate Accelerator?
What is icomparer in c#?
What is the difference between method and constructor in c#?
If I return out of a try/finally in c#, does the code in the finally-clause run?