C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » Visual Studio »

Inheritance confusion solution (csharp)


Posted Date: 28 Aug 2009    Resource Type: Articles    Category: Visual Studio
Author: VeerabaguMember Level: Gold    
Rating: 1 out of 5Points: 6



Inheritance confusion solution (csharp)



If some people have doubt what it is ?

if A class inherit B class, and B class inherit A class what will happen in Csharp like the following example

Example

namespace atobbtoa
{
class Program
{
static void Main(string[] args)
{
a aobj = new a();
aobj.method1();
}
}
class a :b
{
public void method1()
{
Console.Write("veera");
}
}
class b : a
{
public void method2()
{
Console.Write("veera");
}
}
}


Compile Time error will come like this
Error 1 Circular base class dependency involving 'atobbtoa.b' and 'atobbtoa.a' E:\Rnd\atobbtoa\atobbtoa\Program.cs 22 11 atobbtoa



Responses

Author: greeny_1984    31 Aug 2009Member Level: Diamond   Points : 1
Hi,

Nice attempt could have been more effective

with eloborate description about the problem and solution.


Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Inheritance confusion solution (csharp)  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Managed Resources Vs Unmanaged Resources (Use of disposing)
Previous Resource: Working with DataGridViewComboboxColumn
Return to Discussion Resource Index
Post New Resource
Category: Visual Studio


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use