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
Can you instantiate an abstract class c#?
What happens when thread sleep () method is called?
What is concrete class in c#?
What are value types and reference types?
Is char * null terminated?
How does dictionary work in c#?
What is use of hashtable in c#?
What is disconnected data architecture in c#?
Does c# support try-catch-finally blocks?
What is the use of system.environment class in c#.net?
What is the default modifier for class in c#?
What are logical operators in c#?
How long does a loop recorder procedure take?
List the differences between method overriding and method overloading?
Why do we still see so much non-oo code written in c# today?