using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication1
{
    
class Program
    
{
        
static void WriteSomething<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)
        
{
            WriteSomething
<int>(09);
            WriteSomething
<string>("1""10");
            WriteSomething(
09);
            WriteSomething(
"0""9");
            Console.ReadLine();
        }

    }

}
Posted on 2006-09-20 07:08  李通通  阅读(412)  评论(1编辑  收藏  举报