标签:编译器 dao color com class 需求 ret 副本 产生
public class GenericMenthod { public static void GetName(string name) { Console.WriteLine("" + name); } public static void Getid(int id) { Console.WriteLine("" + id); } public static void Get(object Datetime) { Console.WriteLine("" + Datetime); } }
public static void Get<T>(T t) { Console.WriteLine("" + t); }
Console.WriteLine(typeof(List<>));
public class Generic<T> { private static string GenericCache = null; static Generic() { GenericCache = $"{typeof(T).FullName}"; } public static string GetData() { return GenericCache; } } static void Main(string[] args) { for (int i = 0; i < 5; i++) { Console.WriteLine("**********************"); Generic<int>.GetData(); Generic<string>.GetData(); Generic<DateTime>.GetData(); Generic<object>.GetData(); } Console.ReadLine(); }
标签:编译器 dao color com class 需求 ret 副本 产生
原文地址:https://www.cnblogs.com/cg-ww/p/12760544.html