What you want to see on DotNetFunda.com ?
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 37394 |  Welcome, Guest!   Register  Login
 Home > Forums > ASP.NET 4.0 > Multiple inheritance in .net ...
Nishithraj

Multiple inheritance in .net

Replies: 2 | Posted by: Nishithraj on 2/28/2010 | Category: ASP.NET 4.0 Forums | Views: 2043 | Status: [Member]  


Multiple inheritance is not supported in dotnet. But multiple interface supports. Why this kind of behaviour exists.
Any specific reasons??

Mark this as answer, if it is.....

With regards
Nishithraj Narayanan


Reply | Reply with attachment | Alert Moderator

 Responses below this adGet hundreds of .NET Tips and Tricks videos

 Replies

Vuyiswamb
Vuyiswamb  
Posted on: 2/28/2010 4:00:43 PM
Level: NotApplicable | Status: [Member] [MVP] [Administrator]

Well there a many reasons to that

.Net allows you to use mutiple languages and all these languages will behave differently or the aproach will be different on multiple inheritance. Even Java Suffered the same fate as .NET languages. but for more info look at this

http://blogs.msdn.com/csharpfaq/archive/2004/03/07/85562.aspx

Thank you for posting at dotnetfunda

Vuyiswa Maseko



Thank you for posting at Dotnetfunda
[Administrator]

Nishithraj, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Sagarp
Sagarp  
Posted on: 3/25/2010 8:48:35 AM
Level: Bronze | Status: [Member]

//Single Inheritance






public class A


{


public A() { }


}





public class B : A





{


public B() { }


}











//Multiple Interface Inheritance





interface IComparable


{


int CompareTo(object obj);


}





interface ISomethingElse


{


int EqualTo();


}











public class Z : IComparable, ISomethingElse


{


public int CompareTo(object obj)


{


// implementation code goes here


}





public int EqualTo()


{


// implementation code goes here


}





}


Thanks
SagarP
http://www.emanonsolutions.net
http://emanonsolutions.blogspot.com/

Nishithraj, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Reply - Please login to reply


Click here to login & reply

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/21/2013 7:47:42 AM