IT Community - Software Programming, Web Development and Technical Support

Inherit multiple interfaces

This is a discussion on Inherit multiple interfaces within the C# Programming forums, part of the Software Development category; Hi Guys Can you inherit multiple interfaces?...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C# Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 05-30-2007, 04:54 AM
vigneshgets vigneshgets is offline
D-Web Genius
 
Join Date: Mar 2007
Posts: 904
vigneshgets is on a distinguished road
Red face Inherit multiple interfaces

Hi Guys

Can you inherit multiple interfaces?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-12-2007, 04:34 AM
ThaNerd ThaNerd is offline
D-Web Trainee
 
Join Date: Jul 2007
Posts: 8
ThaNerd is on a distinguished road
Thumbs down Re: Inherit multiple interfaces

I'll make the answer short : no.

Quoted from MSDN:
Quote:
No Multiple-Inheritance in .NET

You could try creating a CreditCheckableSalesOrder type that derives from SalesOrder. Some order types would derive from ConfirmableSalesOrder, and some from CreditCheckableSalesOrder, but what about those that need both confirmation and credit checks? One of the limitations on inheritance in the .NET Framework is that a type can only be derived from one base type.

You can't have order types that derive from both ConfirmableOrder and CreditCheckableOrder. This may seem like an arbitrary or misguided limitation, but there are good reasons for it. Multiple-inheritance is supported in C++. However, just about all the other modern object-oriented languages, including Java, have chosen not to allow multiple-inheritance. (Some advanced languages, such as Eiffel, have attempted to work out the kinks of multiple inheritance, and Eiffel for Microsoft .NET even provides the appearance of multiple inheritance within Microsoft .NET.)

The biggest problem with multiple-inheritance is that it allows for ambiguity when the compiler needs to find the correct implementation of a virtual method.
(Inheritance and Interfaces)
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
interfaces ahmad nadeem Java Programming 2 03-24-2008 07:05 AM
Interfaces in C# Sundaram C# Programming 0 10-29-2007 12:09 PM
Can we inherit the java class in C# class vigneshgets C# Programming 1 08-09-2007 07:42 AM
multiple file selection gattuso HTML, CSS and Javascript Coding Techniques 1 08-08-2007 05:36 AM
mysql and mysqli interfaces sivakumar Database Support 1 07-20-2007 02:49 AM


All times are GMT -7. The time now is 09:35 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0