GeekInterview.com
Series: Subject: Topic:
Question: 8 of 21

Interface in C#

If the interface in C# only contains the declaration of the methods and we need to define those methods in the class, then Why we use the interface..???
Asked by: dimplesharma | Member Since Oct-2010 | Asked on: Oct 14th, 2010

View all questions by dimplesharma

Showing Answers 1 - 1 of 1 Answers
TheOutlander

Answered On : Jan 2nd, 2011

View all answers by TheOutlander

Interfaces define a contract. You should use it only if you want to support a group or related functionalities in a class or struct. Otherwise there is no need to use it.

Think about cars - they have similar functionality. That is something you'd want to define in an interface so that it is generic.

Yes  1 User has rated as useful.
  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Question Categories

Algorithm Questions

ColdFusion Interview Questions

Computer Awareness Questions

Delphi Interview Questions

Perl Interview Questions

PHP Interview Questions

Python Interview Questions

VBA Interview Questions

VoiceXML Interview Questions

XML Interview Questions

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.