C# | Type.GetTypeFromHandle() Method Last Updated : 11 Jul, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report Type.GetTypeFromHandle() Method is used to get the type referenced by the specified type handle. Syntax: public static Type GetTypeFromHandle (RuntimeTypeHandle handle); Here, it takes the object which refers to the type. Return Value: This method returns the type referenced by the specified RuntimeTypeHandle, or null if the Value property of handle is null. Below programs illustrate the use of Type.GetTypeFromHandle() Method: Example 1: csharp // C# program to demonstrate the // Type.GetTypeFromHandle() Method using System; using System.Globalization; using System.Reflection; class GFG { // Main Method public static void Main() { // creating and initializing object Type Type type = typeof(int); // creating object of RuntimeTypeHandle // and getting instance of type RuntimeTypeHandle handle = Type.GetTypeHandle(type); // Getting the type referenced by // the specified RuntimeTypeHandle, // using GetTypeFromHandle() Method Type outtype = Type.GetTypeFromHandle(handle); // Display the Result Console.WriteLine("Type referenced is {0}", outtype); Console.WriteLine("Attributes are: " + outtype.Attributes); } } Output: Type referenced is System.RuntimeType Attributes are: AutoLayout, AnsiClass, Class, SequentialLayout, Serializable, BeforeFieldInit Example 2: csharp // C# program to demonstrate the // Type.GetTypeFromHandle() Method using System; using System.Globalization; using System.Reflection; // Defining Empty struct struct Empty {} class GFG { // Main Method public static void Main() { // creating and initializing object Type Type type = typeof(Empty); // creating object of RuntimeTypeHandle // and getting instance of type RuntimeTypeHandle handle = Type.GetTypeHandle(type); // Getting the type referenced by // the specified RuntimeTypeHandle, // using GetTypeFromHandle() Method Type outtype = Type.GetTypeFromHandle(handle); // Display the Result Console.WriteLine("Type referenced is {0}", outtype); Console.WriteLine("Attributes are: " + outtype.Attributes); } } Output: Type referenced is System.RuntimeType Attributes are: AutoLayout, AnsiClass, Class, SequentialLayout, Serializable, BeforeFieldInit Reference: https://learn.microsoft.com/en-us/dotnet/api/system.type.gettypefromhandle?view=netframework-4.8 Comment More infoAdvertise with us Next Article C# | Type.GetInterface() Method R rohitprasad3 Follow Improve Article Tags : C# CSharp-method CSharp-Type-Class Similar Reads 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 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 C# | Type.GetTypeArray() Method Type.GetTypeArray() Method is used to get the types of the objects in the specified array. Syntax: public static Type[] GetTypeArray (object[] args); Here, it takes an array of objects whose types to determine. Return Value: This method returns an array of Type objects representing the types of the 2 min read C# | Type.GetInterface() Method Type.GetInterface() Method is used to gets a specific interface implemented or inherited by the current Type. GetInterface(String) Method This method is used to search for the interface with the specified name. Syntax: public Type GetInterface (string name); Here, it takes the string containing the 4 min read C# | Type.GetInterfaces() Method Type.GetInterfaces() Method is used to get all the interfaces implemented or inherited by the current Type when overridden in a derived class. Syntax: public abstract Type[] GetInterfaces ();Return Value: This method returns an array of Type objects representing all the interfaces implemented or inh 2 min read C# | Type.GetMember() Method Type.GetMember() Method is used to get the specified members of the current Type. There are 3 methods in the overload list of this method as follows: GetMember(String) Method GetMember(String, BindingFlags) Method GetMember(String, MemberTypes, BindingFlags) Method GetMember(String) Method This meth 6 min read Like