C#中的UInt64.GetTypeCode()方法与示例
C#中的UInt64.GetTypeCode()方法用于返回值类型UInt64的TypeCode。
语法
以下是语法-
public TypeCode GetTypeCode ();
示例
现在让我们看一个实现UInt64.GetTypeCode()方法的示例-
using System; public class Demo { public static void Main(){ ulong val1 = 55; ulong val2 = 100; TypeCode type1 = val1.GetTypeCode(); TypeCode type2 = val2.GetTypeCode(); Console.WriteLine("Typecode for val1 = "+type1); Console.WriteLine("Typecode for val2 = "+type2); } }
输出结果
这将产生以下输出-
Typecode for val1 = UInt64 Typecode for val2 = UInt64
示例
现在让我们来看另一个实现UInt32.GetTypeCode()方法的示例-
using System; public class Demo { public static void Main(){ uint val1 = UInt64.MinValue; uint val2 = 0; TypeCode type1 = val1.GetTypeCode(); TypeCode type2 = val2.GetTypeCode(); Console.WriteLine("Typecode for val1 = "+type1); Console.WriteLine("Typecode for val2 = "+type2); } }
输出结果
这将产生以下输出-
Typecode for val1 = UInt64 Typecode for val2 = UInt64