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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            B<string> b = new B<string>();
            b.TValue = "I'm B";
            Console.WriteLine(b.TValue);
            A<string> a = b;
            Console.WriteLine(a.TValue);
            A<object> a2 = b;
            Console.WriteLine(a2.TValue);

        }
    }

    interface A<out T>
    {
        T TValue
        {
            get;
        }
    }

    class B<T> : A<T>
    {
         public T TValue
        {
            get;
            set;
        }

    }


 


}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-17
  • 2022-12-23
  • 2021-11-09
  • 2021-08-08
猜你喜欢
  • 2022-01-05
  • 2022-12-23
  • 2022-12-23
  • 2021-10-22
  • 2021-07-25
相关资源
相似解决方案