Boolean.GetTypeCode Method in C# with Examples Last Updated : 23 Apr, 2019 Comments Improve Suggest changes Like Article Like Report Boolean.GetTypeCode method is used to get the TypeCode for value type Boolean. Syntax: public TypeCode GetTypeCode (); Return Value: This method returns the enumerated constant Boolean. Below programs illustrate the use of the above discussed-method: Example 1: csharp // C# program to illustrate the // Boolean.GetTypeCode() Method using System; class GFG { // Main Method public static void Main() { // Taking a Boolean value bool s1 = true; // Getting the typecode // using GetTypeCode() method TypeCode result = s1.GetTypeCode(); // Display the TypeCode Console.WriteLine("TypeCode for {0} is: {1}", s1, result); } } Output: TypeCode for True is: Boolean Example 2: csharp // C# program to illustrate the // Boolean.GetTypeCode() Method using System; class GFG { // Main Method public static void Main() { // using result() Method result(true); result(false); } // result() method public static void result(bool val) { // using GetTypeCode() method TypeCode code = val.GetTypeCode(); // Display the TypeCode Console.WriteLine("TypeCode for {0} is {1}", val, code); } } Output: TypeCode for True is Boolean TypeCode for False is Boolean Reference: https://docs.microsoft.com/en-us/dotnet/api/system.boolean.gettypecode?view=netframework-4.8 Comment More infoAdvertise with us Next Article Boolean.GetTypeCode Method in C# with Examples K Kirti_Mangal Follow Improve Article Tags : C# CSharp-method CSharp-Boolean-Struct Similar Reads Boolean.GetHashCode() Method in C# with Examples Boolean.GetHashCode() Method is used to return the hash code for this instance. Syntax: public override int GetHashCode (); Return Value: This method returns a 32-bit signed integer hash code. Below programs illustrate the use of Boolean.GetHashCode() Method: Example 1: csharp // C# program to demon 1 min read Int32.GetTypeCode Method in C# with Examples Int32.GetTypeCode method is used to get the TypeCode for value type Int32. Syntax: public TypeCode GetTypeCode (); Return Value: This method returns the enumerated constant Int32. Below programs illustrate the use of the above discussed-method: Example 1: csharp // C# program to illustrate the // In 1 min read Int16.GetTypeCode Method in C# with Examples Int16.GetTypeCode method is used to get the TypeCode for value type Int16. Syntax: public TypeCode GetTypeCode (); Return Value: This method returns the enumerated constant Int16. Below programs illustrate the use of the above discussed-method: Example 1: csharp // C# program to illustrate the // In 1 min read SByte.GetTypeCode Method in C# with Examples SByte.GetTypeCode method is used to get the TypeCode for value type SByte. Syntax: public TypeCode GetTypeCode (); Return Value: This method returns the enumerated constant SByte. Below programs illustrate the use of the above discussed-method: Example 1: csharp // C# program to illustrate the // SB 1 min read Decimal.GetTypeCode Method in C# with Examples Decimal.GetTypeCode method is used to get the TypeCode for value type Decimal. Syntax: public TypeCode GetTypeCode (); Return Value: This method returns the enumerated constant Decimal. Below programs illustrate the use of the above discussed-method: Example 1: csharp // C# program to illustrate the 1 min read Like