C# 泛型类型转换问题

2025-01-19 20:38:32
推荐回答(1个)
回答1:

People m = new MaleHandler();
People f = new FemaleHandler();
List> handlers = new List>();
handlers.Add(m)
handlers.Add(f)
Console.Read();