<?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: Generic Class: Duplicate Method Overloads</title>
	<atom:link href="http://www.csharp411.com/generic-class-duplicate-method-overloads/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.csharp411.com/generic-class-duplicate-method-overloads/</link>
	<description>C# Information, Code, Tips and News</description>
	<lastBuildDate>Thu, 09 Sep 2010 19:15:17 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Moreshwar</title>
		<link>http://www.csharp411.com/generic-class-duplicate-method-overloads/comment-page-1/#comment-5339</link>
		<dc:creator>Moreshwar</dc:creator>
		<pubDate>Fri, 11 Dec 2009 17:24:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/generic-class-duplicate-method-overloads/#comment-5339</guid>
		<description>using System;

namespace GenericDupOverload
{
    class Program
    {
        static void Main( string[] args )
        {
            Generic genInt = new Generic();
            genInt.Add( 3 );
            genInt.Add( &quot;3&quot; );
            Generic genString = new Generic();
            genString.Add( &quot;3&quot; );
            Console.ReadLine();
        }
    }
    public class Generic
    {
        public void Add( T item )
        {
            Console.WriteLine( &quot;Add T&quot; );
        }
        public void Add( string item )
        {
            Console.WriteLine( &quot;Add string&quot; );
        }
    }
}</description>
		<content:encoded><![CDATA[<p>using System;</p>
<p>namespace GenericDupOverload<br />
{<br />
    class Program<br />
    {<br />
        static void Main( string[] args )<br />
        {<br />
            Generic genInt = new Generic();<br />
            genInt.Add( 3 );<br />
            genInt.Add( "3&#8243; );<br />
            Generic genString = new Generic();<br />
            genString.Add( "3&#8243; );<br />
            Console.ReadLine();<br />
        }<br />
    }<br />
    public class Generic<br />
    {<br />
        public void Add( T item )<br />
        {<br />
            Console.WriteLine( "Add T" );<br />
        }<br />
        public void Add( string item )<br />
        {<br />
            Console.WriteLine( "Add string" );<br />
        }<br />
    }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy</title>
		<link>http://www.csharp411.com/generic-class-duplicate-method-overloads/comment-page-1/#comment-4104</link>
		<dc:creator>Andy</dc:creator>
		<pubDate>Fri, 09 Jan 2009 16:36:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/generic-class-duplicate-method-overloads/#comment-4104</guid>
		<description>Actually, I was wrong. I was doing something slightly different and I suspect the same thing will happen in C#. I was creating a variable of type T inside the generic class then passing that to the overloaded method. In this case, as I said, the overload with parameter of type T is called. If I do something more like you are doing here, I get the same results.</description>
		<content:encoded><![CDATA[<p>Actually, I was wrong. I was doing something slightly different and I suspect the same thing will happen in C#. I was creating a variable of type T inside the generic class then passing that to the overloaded method. In this case, as I said, the overload with parameter of type T is called. If I do something more like you are doing here, I get the same results.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: timm</title>
		<link>http://www.csharp411.com/generic-class-duplicate-method-overloads/comment-page-1/#comment-4103</link>
		<dc:creator>timm</dc:creator>
		<pubDate>Fri, 09 Jan 2009 16:15:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/generic-class-duplicate-method-overloads/#comment-4103</guid>
		<description>Unfortunately C# and VB.NET differ in many subtle ways.  Apparently you have discovered another.  Thanks for commenting!</description>
		<content:encoded><![CDATA[<p>Unfortunately C# and VB.NET differ in many subtle ways.  Apparently you have discovered another.  Thanks for commenting!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy</title>
		<link>http://www.csharp411.com/generic-class-duplicate-method-overloads/comment-page-1/#comment-4102</link>
		<dc:creator>Andy</dc:creator>
		<pubDate>Fri, 09 Jan 2009 16:08:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/generic-class-duplicate-method-overloads/#comment-4102</guid>
		<description>Hi, I am trying to do this exact same thing in VB.NET but find the opposite i.e. the method with a paramter typed as T is always the one to get called. Any ideas?</description>
		<content:encoded><![CDATA[<p>Hi, I am trying to do this exact same thing in VB.NET but find the opposite i.e. the method with a paramter typed as T is always the one to get called. Any ideas?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
