Skip to content

Instantly share code, notes, and snippets.

@tnngo2
Created April 27, 2012 09:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tnngo2/2507914 to your computer and use it in GitHub Desktop.
Save tnngo2/2507914 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Theory8;
namespace Theory8_2
{
class Customer
{
public int Id = 5;
}
class BaseClass
{
public virtual bool DoSomething<T>(T obj)
{
Console.WriteLine("base");
return true;
}
}
class GenericMethod:BaseClass
{
public override bool DoSomething(Customer obj)
{
Console.WriteLine("child");
return true;
}
static void Main(string[] args)
{
Object objCus = new Object();
BaseClass obj = new GenericMethod();
obj.DoSomething(objCus);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment