C# | Byte.GetTypeCode() Method Last Updated : 11 Aug, 2021 Comments Improve Suggest changes Like Article Like Report This method is used to return the TypeCode for value type Byte. Syntax: public TypeCode GetTypeCode (); Return Value: It returns the enumerated constant, Byte.Below programs illustrate the use of Byte.GetTypeCode() Method:Example 1: CSharp // C# program to demonstrate // Byte.GetTypeCode() Method using System; class GFG { // Main Method public static void Main() { // Declaring val1 and val2 byte val1; bool val2; // initializing the // val1 and val2 val1 = 12; val2 = true; // getting TypeCode // using GetTypeCode() method TypeCode t1 = val1.GetTypeCode(); TypeCode t2 = val2.GetTypeCode(); // Display TypeCode Console.WriteLine("TypeCode of val1 is {0}", t1); Console.WriteLine("TypeCode of val2 is {0}", t2); } } Output: TypeCode of val1 is Byte TypeCode of val2 is Boolean Example 2: csharp // C# program to demonstrate // Byte.GetTypeCode() Method using System; class GFG { // Main Method public static void Main() { // Declaring val1 and val2 byte val1; bool val2; // initializing the // val1 and val2 val1 = 12; val2 = true; // calling get() method get(val1); get(val2); } // Defining the get() method public static void get(byte val) { // getting TypeCode // using GetTypeCode() method TypeCode t = val.GetTypeCode(); // Display the TypeCode Console.WriteLine("TypeCode of {0} is {1}", val, t); } public static void get(bool val) { // getting TypeCode // using GetTypeCode() method TypeCode t = val.GetTypeCode(); // Display the TypeCode Console.WriteLine("TypeCode of {0} is {1}", val, t); } } Output: TypeCode of 12 is Byte TypeCode of True is Boolean Reference: https://docs.microsoft.com/en-us/dotnet/api/system.byte.gettypecode?view=netframework-4.7.2 Comment More infoAdvertise with us Next Article C# | Byte.GetTypeCode() Method rohitprasad3 Follow Improve Article Tags : C# CSharp-method CSharp-Byte-Struct Similar Reads C# | Byte.GetHashCode() Method This method is used to return the hash code for the given byte.Syntax: public override int GetHashCode (); Return Value: This method returns a hash code for the current Byte.Below programs illustrate the use of Byte.GetHashCode() Method:Example 1: CSHARP // C# program to demonstrate // Byte.GetHashC 2 min read C# | Type.GetTypeCode() Method Type.GetTypeCode() Method is used to get the underlying type code of the specified Type. Syntax: public static TypeCode GetTypeCode (Type type); Here, it takes the type whose underlying type code to get. Return Value: This method returns the code of the underlying type, or Empty if type is null. Bel 2 min read DateTime.GetTypeCode() Method in C# This method is used to return the TypeCode for value type DateTime. Syntax: public TypeCode GetTypeCode (); Return Value: This method returns the enumerated constant, DateTime. Below programs illustrate the use of DateTime.GetTypeCode() Method Example 1: csharp // C# program to demonstrate the // Da 1 min read C# | Convert.GetTypeCode(Object) Method This method is used to return the TypeCode for the specified object.Syntax: public static TypeCode GetTypeCode (object value); Here, the value is an object that implements the IConvertible interface.Return Value: This method returns the TypeCode for value, or Empty if value is null.Below programs il 2 min read C# | Type.GetTypeHandle() Method Type.GetTypeHandle() Method is used to get the handle for the Type of a specified object. Syntax: public static RuntimeTypeHandle GetTypeHandle (object o); Here, it takes the object for which to get the type handle. Return Value: This method returns The handle for the Type of the specified Object. E 2 min read Like