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:
ElementType is: System.Int32
Element type of GFG is null
- Difference between Method Overriding and Method Hiding in C#
- C# | Remove() Method
- Extension Method in C#
- C# | String.Contains() Method
- C# | CompareOrdinal() Method
- C# | ToLower() Method
- TimeSpan.Add() Method in C#
- Stack.Pop() Method in C#
- Method Hiding in C#
- C# | Method Overriding
- C# | Insert() Method
- C# | Replace() Method
- C# | IsNullOrWhiteSpace() Method
- C# | ToCharArray() Method
- C# | SortedDictionary.Add() Method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.