Why do we need interfaces?
Answers were Sorted based on User's Feedback
Answer / shivacharan
Reason1: In C# Multiple inheritence concept will be
implemented by Interfaces.
Reason2: When multiple ppl are working on one sigle
project, if they need to use some common functionality (for
example initializing the variables for thier modules)
instead of writing their own function name (like init,
initialize, setup etc etc) if we can write one single
function name (lets say initialize) then this function can
be implemented by any user who derives. That's it.
public interface IInitialize
{
void InitializeVar();
}
public classs Box:IInitialize
{
void InitializeVar()
{
//initializion of variables goes here
}
public classs Rectangle:IInitialize
{
void InitializeVar()
{
//initializion of variables goes here
}
this wil avoid all the confusion
| Is This Answer Correct ? | 23 Yes | 1 No |
Answer / raman
when we wont to add new extended features we can go for
the interfaces.once you decalare the interface we need to
get those extented features we need to implent those
methods
| Is This Answer Correct ? | 11 Yes | 1 No |
How can you set image source dynamically from c# application to ”test.png” file?
What is asynchronous one-way calls?
What is Implicit conversion in C#?
What does console readline do?
Define satellite assembly in c#?
What is the default value of decimal in c#?
What is a predicate in c#?
What is lazy class in c#?
How to implement a singleton design pattern in c#?
Is comparable a functional interface?
What is an inheritance in c#?
What do you mean by shared assembly?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)