Y go for Interface? What is use of interface?
Answers were Sorted based on User's Feedback
Answer / purushotham .tella
An Interface is a collection of semantically related
abstract members.Used To Support Multiple Inheritance
Is This Answer Correct ? | 6 Yes | 0 No |
Answer / venkat2050
interfaces is in concept of late binding which happen at
runtime which a part in OOPs concept
the interface has indexes of abstact
it should in public
Is This Answer Correct ? | 4 Yes | 2 No |
We will go for an interface when we want to implement a
specific behaviour.
ex:
1.My class x implements IDisposable interface to handle
cleaup operation. I have to implement that behaviour by
implementing the method interface method Dispose()
explicitly in my code.
class x:IDisposable
{}
2.My class y implements IComparable interface to implement
sorting between a list of objects created of type y. Here I
have to implement CompareTo method.
Is This Answer Correct ? | 3 Yes | 1 No |
What is difference between string and stringbuffer in c#?
Can you create sealed abstract class in c#?
Where test director stores its data ? Database ,Local file etc...? I need to read this data from Visual Studio 2005 c# client. Regards
Why delegates are type safe in c#?
What is a delegate in c#?
What is a strong name in c#?
What?s the C# equivalent of C++ catch (?), which was a catch-all statement for any possible exception?
What is threading in c# with example?
What is the difference between static class and singleton class in c#?
What is difference between abstract class and interface in c#?
Is arraylist type safe in c#?
What is the c# equivalent of c++ catch (...), Which was a catch-all statement for any possible exception?