C# | Type.GetElementType() Method Last Updated : 11 Jul, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report Type.GetElementType() Method is used to return the Type of the object encompassed or referred to by the current array, pointer or reference type when overridden in a derived class. Syntax: public abstract Type GetElementType (); Return Value: This method returns the Type of the object encompassed or referred to by the current array, pointer, or reference type, or null if the current Type is not an array or a pointer, or is not passed by reference, or represents a generic type or a type parameter in the definition of a generic type or generic method. Below programs illustrate the use of Type.GetElementType() Method: Example 1: csharp // C# program to demonstrate the // Type.GetElementType() Method using System; using System.Globalization; using System.Reflection; class GFG { // Main Method public static void Main() { // Declaring and initializing type Type type = typeof(int[,, ]); // using GetElementType() Method Type t = type.GetElementType(); // Display the ElementType Console.WriteLine("ElementType is: {0}", t); } } Output: ElementType is: System.Int32 Example 2: csharp // C# program to demonstrate the // Type.GetElementType() Method using System; using System.Globalization; using System.Reflection; class GFG { // Main Method public static void Main() { // Creating the object of class GFG obj = new GFG(); Type typ1 = obj.GetType(); Type typ2 = typ1.GetElementType(); Console.WriteLine("Element type of {0} is {1}", obj, typ2==null? "null" : typ2.ToString()); } } Output: Element type of GFG is null Reference: https://learn.microsoft.com/en-us/dotnet/api/system.type.getelementtype?view=netframework-4.8 Comment More infoAdvertise with us Next Article C# | Type.GetNestedType() Method R rohitprasad3 Follow Improve Article Tags : C# CSharp-method CSharp-Type-Class Similar Reads C# | Type.GetNestedType() Method Type.GetNestedType() Method is used to get a specific type nested within the current Type. There are 2 methods in the overload list of this method as follows: GetNestedType(String, BindingFlags) Method GetNestedType(String) Method GetNestedType(String, BindingFlags) Method This method is used to sea 4 min read C# | Type.GetNestedType() Method Type.GetNestedType() Method is used to get a specific type nested within the current Type. There are 2 methods in the overload list of this method as follows: GetNestedType(String, BindingFlags) Method GetNestedType(String) Method GetNestedType(String, BindingFlags) Method This method is used to sea 4 min read C# | Type.HasElementTypeImpl() Method Type.HasElementTypeImpl() Method is used when overridden in a derived class, implementing the HasElementType property and determines whether the current Type encompasses or refers to another type. It means this method checks whether the current Type is an array, a pointer, or is passed by reference. 3 min read C# | Type.HasElementTypeImpl() Method Type.HasElementTypeImpl() Method is used when overridden in a derived class, implementing the HasElementType property and determines whether the current Type encompasses or refers to another type. It means this method checks whether the current Type is an array, a pointer, or is passed by reference. 3 min read C# | Type.GetNestedTypes() Method Type.GetNestedTypes() Method is used to get the types nested within the current Type. There are 2 methods in the overload list of this method as follows: GetNestedTypes() Method This method is used to return the public types nested in the current Type. Syntax: public Type[] GetNestedTypes ();Return 5 min read C# | Type.GetNestedTypes() Method Type.GetNestedTypes() Method is used to get the types nested within the current Type. There are 2 methods in the overload list of this method as follows: GetNestedTypes() Method This method is used to return the public types nested in the current Type. Syntax: public Type[] GetNestedTypes ();Return 5 min read Like