C
Christof Nordiek
Given the following code
Is there any way to call one of the Bar methods.
using System;
class Program
{
static void Main()
{
Foo<string, string> foo = new Foo<string,string>();
string s = "";
foo.Bar(s); // Compiler error CS0121
}
}
class Foo<T, S>
{
public void Bar(T a)
{
Console.WriteLine("Bar(T)");
}
public void Bar(S a)
{
Console.WriteLine("Bar(S)");
}
}
Is there any way to call one of the Bar methods.
using System;
class Program
{
static void Main()
{
Foo<string, string> foo = new Foo<string,string>();
string s = "";
foo.Bar(s); // Compiler error CS0121
}
}
class Foo<T, S>
{
public void Bar(T a)
{
Console.WriteLine("Bar(T)");
}
public void Bar(S a)
{
Console.WriteLine("Bar(S)");
}
}