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...


Why do we need interfaces?

Answers were Sorted based on User's Feedback



Why do we need interfaces?..

Answer / shivacharan

Reason1: In C# Multiple inheritence concept will be
implemented by Interfaces.
Reason2: When multiple ppl are working on one sigle
project, if they need to use some common functionality (for
example initializing the variables for thier modules)
instead of writing their own function name (like init,
initialize, setup etc etc) if we can write one single
function name (lets say initialize) then this function can
be implemented by any user who derives. That's it.

public interface IInitialize
{
void InitializeVar();
}
public classs Box:IInitialize
{
void InitializeVar()
{
//initializion of variables goes here
}
public classs Rectangle:IInitialize
{
void InitializeVar()
{
//initializion of variables goes here
}

this wil avoid all the confusion

Is This Answer Correct ?    23 Yes 1 No

Why do we need interfaces?..

Answer / raman

when we wont to add new extended features we can go for
the interfaces.once you decalare the interface we need to
get those extented features we need to implent those
methods

Is This Answer Correct ?    11 Yes 1 No

Post New Answer

More C Sharp Interview Questions

what is generics? can u explain 5 to 6 examples on generics that covers class,method,structure,list,delegates?

2 Answers   Satyam,


What is the usage of transponders?

0 Answers   Wipro,


What?s a satellite assembly?

1 Answers  


If a.equals(b) is true then a.gethashcode & b.gethashcode must always return same hash code.

0 Answers  


What is data type c#?

0 Answers  


What is an object pool in .net?

0 Answers  


What is xml serialization and deserialization in c#?

0 Answers  


What is asynchronous one-way calls?

0 Answers  


WHAT IS THE DIFFERENCE BETWEEN STRING AND STRING BUILDER ?

3 Answers  


What is immutable in C#?

0 Answers   SwanSoft Technologies,


Why singleton class is sealed?

0 Answers  


What are the applications of c#?

3 Answers  


Categories