C# | Type.HasElementTypeImpl() Method Last Updated : 11 Jul, 2025 Comments Improve Suggest changes Like Article Like Report 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. Syntax: protected abstract bool HasElementTypeImpl (); Return Value: This method returns true if the Type is an array, a pointer, or is passed by reference otherwise, false. Below programs illustrate the use of Type.HasElementTypeImpl() Method: Example 1: csharp // C# program to demonstrate the // Type.HasElementTypeImpl() Method using System; using System.Globalization; using System.Reflection; class GFG { // Main Method public static void Main() { // creating and initializing object of MyClass MyClass mytype = new MyClass(typeof(int)); // checking if mytype has any elementtype or not if (mytype.HasElementType) Console.WriteLine("The type of myArray is {0}.", mytype.elementtype); else Console.WriteLine("myArray is not an array, pointer, or reference type."); } } // Defining MyClass extended from TypeDelegator public class MyClass : TypeDelegator { // creating and initializing elementtype with null public string elementtype = null; // creating and initializing type with null private Type type = null; // Constructor public MyClass(Type type) : base(type) { this.type = type; } // Override Type.HasElementTypeImpl(). protected override bool HasElementTypeImpl() { // Determine whether the type is an array. if (type.IsArray) { elementtype = "array"; return true; } // Determine whether the type is a reference. if (type.IsByRef) { elementtype = "reference"; return true; } // Determine whether the type is a pointer. if (type.IsPointer) { elementtype = "pointer"; return true; } // Return false if the type is not // a reference, array, or pointer type. return false; } } Output: myArray is not an array, pointer, or reference type. Example 2: csharp // C# program to demonstrate the // Type.HasElementTypeImpl() Method using System; using System.Globalization; using System.Reflection; class GFG { // Main Method public static void Main() { // creating and initializing object of MyClass MyClass mytype = new MyClass(typeof(int[,,,,,, ])); // checking if mytype has any elementtype or not if (mytype.HasElementType) Console.WriteLine("The type of {1} is {0}.", mytype.elementtype, mytype.type); else Console.WriteLine("{0} is not an array, pointer, or reference type.", mytype.type); } } // Defining MyClass extended from TypeDelegator public class MyClass : TypeDelegator { // creating and initializing elementtype with null public string elementtype = null; // creating and initializing type with null public Type type = null; // Constructor public MyClass(Type type) : base(type) { this.type = type; } // Override Type.HasElementTypeImpl(). protected override bool HasElementTypeImpl() { // Determine whether the type is an array. if (type.IsArray) { elementtype = "array"; return true; } // Determine whether the type is a reference. if (type.IsByRef) { elementtype = "reference"; return true; } // Determine whether the type is a pointer. if (type.IsPointer) { elementtype = "pointer"; return true; } // Return false if the type is not a // reference, array, or a pointer type return false; } } Output: The type of System.Int32[,,,,,,] is array. Reference: https://learn.microsoft.com/en-us/dotnet/api/system.type.haselementtypeimpl?view=netframework-4.8 Create Quiz Comment R rohitprasad3 Follow 0 Improve R rohitprasad3 Follow 0 Improve Article Tags : C# CSharp-method CSharp-Type-Class Explore IntroductionC# Tutorial 2 min read Introduction to .NET Framework 6 min read C# .NET Framework (Basic Architecture and Component Stack) 6 min read C# Hello World 2 min read Common Language Runtime (CLR) in C# 4 min read FundamentalsC# Identifiers 2 min read Data Types in C# 6 min read C# Variables 4 min read C# Literals 5 min read Operators in C# 7 min read C# Keywords 5 min read Control StatementsC# Decision Making (if, if-else, if-else-if ladder, nested if, switch, nested switch) 5 min read C# Switch Statement 4 min read Loops in C# 4 min read C# Jump Statements (Break, Continue, Goto, Return and Throw) 4 min read OOP ConceptsClass and Objects in C# 4 min read Constructors in C# 5 min read C# Inheritance 3 min read Encapsulation in C# 2 min read C# Abstraction 4 min read MethodsMethods in C# 4 min read Method Overloading in C# 4 min read Method Parameters in C# 4 min read Method Overriding in C# 7 min read Anonymous Method in C# 2 min read ArraysArrays in C# 6 min read Jagged Arrays in C# 4 min read Array Class in C# 5 min read How to Sort an Array in C# | Array.Sort() Method Set - 1 8 min read How to find the rank of an array in C# 2 min read ArrayListArrayList in C# 6 min read ArrayList Class in C# 4 min read C# | Array vs ArrayList 2 min read StringStrings in C# 6 min read C# Verbatim String Literal - @ 5 min read C# String Class 9 min read C# StringBuilder 2 min read C# String vs StringBuilder 3 min read TupleC# Tuple 7 min read C# Tuple Class 3 min read C# ValueTuple 7 min read C# ValueTuple Struct 4 min read IndexersC# Indexers 5 min read C# Multidimensional Indexers 5 min read C# - Overloading of Indexers 3 min read Like