<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: C# Inheritance Question</title>
	<atom:link href="http://kossovsky.net/index.php/2009/06/csharp-inheritance-question/feed/" rel="self" type="application/rss+xml" />
	<link>http://kossovsky.net/index.php/2009/06/csharp-inheritance-question/</link>
	<description>C# Code Snippets, ASP.NET Code Samples, .NET Tips and Tricks</description>
	<lastBuildDate>Tue, 31 Jan 2012 06:04:50 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
	<item>
		<title>By: Bvenkat Jeewesh</title>
		<link>http://kossovsky.net/index.php/2009/06/csharp-inheritance-question/comment-page-1/#comment-9611</link>
		<dc:creator>Bvenkat Jeewesh</dc:creator>
		<pubDate>Mon, 06 Jun 2011 05:02:26 +0000</pubDate>
		<guid isPermaLink="false">http://kossovsky.net/?p=191#comment-9611</guid>
		<description>Nice Question.
I have done it.
Bvenkat Jeewesh</description>
		<content:encoded><![CDATA[<p>Nice Question.<br />
I have done it.<br />
Bvenkat Jeewesh</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dinesh</title>
		<link>http://kossovsky.net/index.php/2009/06/csharp-inheritance-question/comment-page-1/#comment-5654</link>
		<dc:creator>Dinesh</dc:creator>
		<pubDate>Fri, 14 Jan 2011 04:45:29 +0000</pubDate>
		<guid isPermaLink="false">http://kossovsky.net/?p=191#comment-5654</guid>
		<description>Ans of First Question is &#039;B&#039; Because in inheritance Always First Hit the drive Class Method then Base Class if Both Drive And Base Class Have Same Method name then it first Call The  Drive Class Method and Hide The Base Class Method if Want To Call Base Class Method Then You Have Use base KeyWord With Method.

Ans Of Second Question is A in this Type of Datatype you have Pass in method is called First</description>
		<content:encoded><![CDATA[<p>Ans of First Question is &#8216;B&#8217; Because in inheritance Always First Hit the drive Class Method then Base Class if Both Drive And Base Class Have Same Method name then it first Call The  Drive Class Method and Hide The Base Class Method if Want To Call Base Class Method Then You Have Use base KeyWord With Method.</p>
<p>Ans Of Second Question is A in this Type of Datatype you have Pass in method is called First</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: adamLee</title>
		<link>http://kossovsky.net/index.php/2009/06/csharp-inheritance-question/comment-page-1/#comment-99</link>
		<dc:creator>adamLee</dc:creator>
		<pubDate>Wed, 15 Jul 2009 17:01:23 +0000</pubDate>
		<guid isPermaLink="false">http://kossovsky.net/?p=191#comment-99</guid>
		<description>It&#039;s a interesting question,
I guess it was caused by the predefined implicit conversion of int in the inheritance.
http://msdn.microsoft.com/en-us/library/5kzh1b5w%28VS.80%29.aspx

So, if change the float to long,double or decimal,
it sure be has the same problem.</description>
		<content:encoded><![CDATA[<p>It&#8217;s a interesting question,<br />
I guess it was caused by the predefined implicit conversion of int in the inheritance.<br />
<a href="http://msdn.microsoft.com/en-us/library/5kzh1b5w%28VS.80%29.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/5kzh1b5w%28VS.80%29.aspx</a></p>
<p>So, if change the float to long,double or decimal,<br />
it sure be has the same problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xander</title>
		<link>http://kossovsky.net/index.php/2009/06/csharp-inheritance-question/comment-page-1/#comment-81</link>
		<dc:creator>Xander</dc:creator>
		<pubDate>Tue, 14 Jul 2009 04:28:48 +0000</pubDate>
		<guid isPermaLink="false">http://kossovsky.net/?p=191#comment-81</guid>
		<description>You right, but this question is not about Good design or Bad design - it&#039;s about how well can you read and understand the code.

Most of the tricky questions can&#039;t be categorized as a Good Design.

For example, are you familiar with the &#039;@&#039; prefix ? 
&lt;pre class=&quot;c-sharp&quot; name=&quot;code&quot;&gt;
int @int = 1;
&lt;/pre&gt;
The above line will compile and for my opinion it&#039;s a terrible thing to use in your code, but despite all of that a developer must know about it&#039;s existence and what it suppose to do.</description>
		<content:encoded><![CDATA[<p>You right, but this question is not about Good design or Bad design &#8211; it&#8217;s about how well can you read and understand the code.</p>
<p>Most of the tricky questions can&#8217;t be categorized as a Good Design.</p>
<p>For example, are you familiar with the &#8216;@&#8217; prefix ? </p>
<pre class="c-sharp" name="code">
int @int = 1;
</pre>
<p>The above line will compile and for my opinion it&#8217;s a terrible thing to use in your code, but despite all of that a developer must know about it&#8217;s existence and what it suppose to do.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Al Tenhundfeld</title>
		<link>http://kossovsky.net/index.php/2009/06/csharp-inheritance-question/comment-page-1/#comment-69</link>
		<dc:creator>Al Tenhundfeld</dc:creator>
		<pubDate>Mon, 13 Jul 2009 20:17:34 +0000</pubDate>
		<guid isPermaLink="false">http://kossovsky.net/?p=191#comment-69</guid>
		<description>In general, you should avoid creating more abstract/&quot;bigger&quot; overloads in a derived class. In your derived classes, i.e., smaller/more specific classes, your method overloads should be smaller/more specific as well. 

(I might be misusing the terms bigger and smaller, which are really about covariance and contravariance, but that&#039;s how I think about it. By bigger, I don&#039;t just mean supertype.) 

If A has Get(string value), think carefully before you create an overload in B Get(object value). Also, if A has Get(string[] values), you should be cautious creating overload Get(object[] values) in B.

Of course there are exceptions to this rule, but I think it helps avoid this type of confusion.

And I get your point in this context, but there&#039;s more difference with static methods than simply not being able to make them virtual.</description>
		<content:encoded><![CDATA[<p>In general, you should avoid creating more abstract/&#8221;bigger&#8221; overloads in a derived class. In your derived classes, i.e., smaller/more specific classes, your method overloads should be smaller/more specific as well. </p>
<p>(I might be misusing the terms bigger and smaller, which are really about covariance and contravariance, but that&#8217;s how I think about it. By bigger, I don&#8217;t just mean supertype.) </p>
<p>If A has Get(string value), think carefully before you create an overload in B Get(object value). Also, if A has Get(string[] values), you should be cautious creating overload Get(object[] values) in B.</p>
<p>Of course there are exceptions to this rule, but I think it helps avoid this type of confusion.</p>
<p>And I get your point in this context, but there&#8217;s more difference with static methods than simply not being able to make them virtual.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xander</title>
		<link>http://kossovsky.net/index.php/2009/06/csharp-inheritance-question/comment-page-1/#comment-67</link>
		<dc:creator>Xander</dc:creator>
		<pubDate>Mon, 13 Jul 2009 16:38:36 +0000</pubDate>
		<guid isPermaLink="false">http://kossovsky.net/?p=191#comment-67</guid>
		<description>Bob,  static methods are just like instance methods ( except you can&#039;t make it virtual) and i used them to avoid instance creation.
You can easily remove the &quot;static&quot; modifier and create an instance of &quot;B&quot; before calling the &quot;Get&quot; method, and you will get the same result.

What’s this got to do with inheritance ? Well, this is exactly what i am trying to show here. First level methods are prioritized over any inherited method in case of parameters suitability.</description>
		<content:encoded><![CDATA[<p>Bob,  static methods are just like instance methods ( except you can&#8217;t make it virtual) and i used them to avoid instance creation.<br />
You can easily remove the &#8220;static&#8221; modifier and create an instance of &#8220;B&#8221; before calling the &#8220;Get&#8221; method, and you will get the same result.</p>
<p>What’s this got to do with inheritance ? Well, this is exactly what i am trying to show here. First level methods are prioritized over any inherited method in case of parameters suitability.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bob Saggett</title>
		<link>http://kossovsky.net/index.php/2009/06/csharp-inheritance-question/comment-page-1/#comment-66</link>
		<dc:creator>Bob Saggett</dc:creator>
		<pubDate>Mon, 13 Jul 2009 16:18:56 +0000</pubDate>
		<guid isPermaLink="false">http://kossovsky.net/?p=191#comment-66</guid>
		<description>What&#039;s this got to do with inheritance? You are using static methods which are not included in inheritance relationships in C# anyway. This is about overloading.</description>
		<content:encoded><![CDATA[<p>What&#8217;s this got to do with inheritance? You are using static methods which are not included in inheritance relationships in C# anyway. This is about overloading.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xander</title>
		<link>http://kossovsky.net/index.php/2009/06/csharp-inheritance-question/comment-page-1/#comment-65</link>
		<dc:creator>Xander</dc:creator>
		<pubDate>Mon, 13 Jul 2009 16:11:46 +0000</pubDate>
		<guid isPermaLink="false">http://kossovsky.net/?p=191#comment-65</guid>
		<description>&lt;a href=&quot;#comment-64&quot; rel=&quot;nofollow&quot;&gt;@Kaveh Shahbazian &lt;/a&gt; 
I have to disagree with you. 

Overloading is something very obvious (in most cases) and as you can see it works exactly as expected in Question #2.

Overloading has it&#039;s own priorities, for example &lt;T&gt; priority is higher than &quot;object&quot;.

My example is about how inheritance affects the &quot;obvious&quot; overloading.</description>
		<content:encoded><![CDATA[<p><a href="#comment-64" rel="nofollow">@Kaveh Shahbazian </a><br />
I have to disagree with you. </p>
<p>Overloading is something very obvious (in most cases) and as you can see it works exactly as expected in Question #2.</p>
<p>Overloading has it&#8217;s own priorities, for example &lt;T&gt; priority is higher than &#8220;object&#8221;.</p>
<p>My example is about how inheritance affects the &#8220;obvious&#8221; overloading.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kaveh Shahbazian</title>
		<link>http://kossovsky.net/index.php/2009/06/csharp-inheritance-question/comment-page-1/#comment-64</link>
		<dc:creator>Kaveh Shahbazian</dc:creator>
		<pubDate>Mon, 13 Jul 2009 15:46:29 +0000</pubDate>
		<guid isPermaLink="false">http://kossovsky.net/?p=191#comment-64</guid>
		<description>I think it is more about method overloading than inheritance.</description>
		<content:encoded><![CDATA[<p>I think it is more about method overloading than inheritance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gever</title>
		<link>http://kossovsky.net/index.php/2009/06/csharp-inheritance-question/comment-page-1/#comment-61</link>
		<dc:creator>Gever</dc:creator>
		<pubDate>Mon, 13 Jul 2009 11:25:35 +0000</pubDate>
		<guid isPermaLink="false">http://kossovsky.net/?p=191#comment-61</guid>
		<description>First &quot;B&quot; Second &quot;A&quot;</description>
		<content:encoded><![CDATA[<p>First &#8220;B&#8221; Second &#8220;A&#8221;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

