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 the difference between system.string and system.text.stringbuilder classes?

594


What is the difference between function and method in c#?

535


What is the difference between func and action delegate?

555


Describe the types of comments in c#?

598


What is a private class in c#?

565






How to add a readonly property in c#.net

586


Can we create instance of private class in c#?

583


Why do I get a "cs5001: does not have an entry point defined" error when compiling?

604


What is use of console?

568


What are the types of comment in c# with examples?

565


What is an assembly in .net?

655


What is the correct way of declaring an xml namespace?

551


What are nested classes in c#?

626


List the fundamental oop concepts?

606


What is lazy keyword in c#?

605