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


Please Help Members By Posting Answers For Below Questions

What is immutable in C#?

599


Which of the following operations can you not perform on an ado.net dataset?

529


From a versioning perspective, what are the drawbacks of extending an interface as opposed to extending a class?

522


Is c# and c sharp same?

493


What do constructors do in c#?

516






Why is xml called extensible?

507


Define xslt.

554


Give an example of a ctype.

567


Explain use of abstract and sealed classes in c#?

465


What is difference between internal and protected internal in c#?

470


Differentiate between the public and private ?

573


What Happens In Memory When You Box And Unbox A Value-type?

481


What is a class c#?

487


What is the difference between constant and readonly in c#?

445


What's difference between constants and static readonly?

539