explain which situation we use interface in projects

Posted by Sekar.C under Interview Questions on 4/23/2012 | Points: 10 | Views : 1415 | Status : [Member] | Replies : 2
Hi,
explain which situation we use interface in projects own words with example
Regards
sekar.c

Regards
Sekar.c



Responses

Posted by: Dotnetrajanikanth on: 4/23/2012 [Member] Starter | Points: 25

Up
0
Down
Interfaces are better suited to situations in which your applications require many possibly unrelated object types to provide certain functionality.

Interfaces are more flexible than base classes because you can define a single implementation that can implement multiple interfaces.

Interfaces are better in situations in which you do not need to inherit implementation from a base class.

Interfaces are useful in cases where you cannot use class inheritance. For example, structures cannot inherit from classes, but they can implement interfaces.


____________
www.flickr.com/photos/psdesigner/

Sekar.C, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 4/23/2012 [Member] Silver | Points: 25

Up
0
Down
when we using common methods to many places, on that we declare function in interface and use it to many places..

Regards,
Singaravel M

Sekar.C, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response