class Program
{
static void WriteSometing<T>(T x,T y)
{
if (typeof(T) == typeof(int))
Console.WriteLine(x);
if (typeof(T) == typeof(string))
Console.WriteLine(y);
}
static void Main(string[] args)
{
WriteSometing<int>(0, 9);
WriteSometing<string>("0", "9");
WriteSometing(0, 9);
WriteSometing("0", "9");
Console.ReadLine();
}
}
//范型是指在方法傳入參數的時候 不用定義 參數的數據類型