UInt64.GetTypeCode() Method in C# with Examples


The UInt64.GetTypeCode() method in C# is used to return the TypeCode for value type UInt64.

Syntax

Following is the syntax −

public TypeCode GetTypeCode ();

Example

Let us now see an example to implement the UInt64.GetTypeCode() method −

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);
   }
}

Output

This will produce the following output −

Typecode for val1 = UInt64
Typecode for val2 = UInt64

Example

Let us now see another example to implement the UInt32.GetTypeCode() method −

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);
   }
}

Output

This will produce the following output −

Typecode for val1 = UInt64
Typecode for val2 = UInt64

Updated on: 07-Nov-2019

49 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements