Answer Posted / kiran
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 |
Post New Answer View All Answers
What is deferred execution?
What are data types with examples?
What is a generic class?
What do you mean by object pooling?
Explain Constructor and destructor?
How can you force derived classes to provide new method implementations for virtual methods?
What are cookies in c#?
List down the differences between public, static and void keywords?
What is a copy constructor in c#?
Who benefits from ajax?
How do you create dlls in .NET
What is difference between C# and VB.NET?
What is literal control
Explain what a diffgram, and a good use for one Define diffgram? How it be used?
Explain the top reason to use c# language?