Esempio n. 1
0
    public static void Main()
    {
        Hello <int> hello = new Hello <int> ();

        hello.Print(5);
        hello.Test <float> ().Print(3.14F);

        IHello <string> foo = hello.Test <string> ();

        foo.Print("World");
    }
Esempio n. 2
0
    static void Test1()
    {
        Console.WriteLine("----Test1");
        try
        {
            Hello <int> hello = new Hello <int>();
            hello.Print(5);
            hello.Test <float>().Print(3.14F);

            IHello <string> foo = hello.Test <string>();
            foo.Print("World");
        }
        catch (Exception e)
        {
            Console.WriteLine("error" + e);
        }
    }