Array.GetLongLength(Int32) Method is used to get a 64-bit integer that represents the number of elements in the specified dimension of the Array.
public long GetLongLength (int dimension);
Here, dimension is the zero-based dimension of the Array whose length is to be calculated.
Return Value: It returns a
64-bit integer that represents the number of elements in the specified dimension.
Exception: This method throws IndexOutOfRangeException if the dimension is less than zero or greater than or equal to Rank.
Total Number of Elements in first dimension of arr: 3 Type of returned Length: System.Int64 Total Number of Elements in second dimension of arr: 3 Type of returned Length: System.Int32 Total Number of Elements in second dimension of arr: 3 Type of returned Length: System.Int64
Note: In the above program, GetLength method return type is
System.Int32 but the GetLongLength method return type is
- C# | Total number of elements present in an array
- C# | Count the total number of elements in the List
- C# | Copying the Collection<T> elements to an array
- C# | Copying the elements of ArrayList to a new array
- C# | Copying BitArray elements to an Array
- Copying the Queue elements to 1-D Array in C#
- C# | Copying the Hashtable elements to an Array Instance
- C# | Copying the SortedList elements to an Array Object
- C# | Check if an array contain the elements that match the specified conditions
- C# | Copy the elements of a string array to the end of the StringCollection
- C# | Copy OrderedDictionary elements to Array instance at the specified index
- C# | Get or set the number of elements in the BitArray
- C# | Get the number of elements in the SortedSet
- C# | Number of elements in HashSet
- C# | Get or set the number of elements that the ArrayList can contain
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.