Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Y go for Interface? What is use of interface?

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


Please Help Members By Posting Answers For Below Questions

What is deferred execution?

873


What are data types with examples?

964


What is a generic class?

956


What do you mean by object pooling?

1002


Explain Constructor and destructor?

943


How can you force derived classes to provide new method implementations for virtual methods?

895


What are cookies in c#?

952


List down the differences between public, static and void keywords?

859


What is a copy constructor in c#?

979


Who benefits from ajax?

966


How do you create dlls in .NET

1036


What is difference between C# and VB.NET?

1113


What is literal control

993


Explain what a diffgram, and a good use for one Define diffgram? How it be used?

983


Explain the top reason to use c# language?

926