![]() |
VOOZH | about |
Array.GetValue() Method in C# is used to gets the value of the specified element in the current Array. There are total 8 methods in the overload list of this method which are as follows:
In this article we are explaining Array.GetValue(Int32, Int32, Int32) and Array.GetValue(Int64, Int64, Int64) method.
Array.GetValue(Int32, Int32, Int32) method is used to get the value at the specified position in the three-dimensional Array. The indexes are specified as 32-bit integers.
Syntax:
public object GetValue (int index1, int index2, int index3);
Here,
Returns: This method returns the element at the specified index define by the passed parameters in the 3D array. The value is a 32-bit integer value.
Exceptions:
Array.GetValue(Int64, Int64, Int64) method is used to get the value at the specified position in the three-dimensional Array. The indexes are specified as 64-bit integers.
Syntax:
public object GetValue (long index1, long index2, long index3);
Here,
Returns: This method returns the element at the specified index define by the passed parameters in the 3D array. The value is a 64-bit integer value.
Exceptions:
Example 1:
element at index [0, 0, 0] is : A element at index [0, 0, 1] is : B element at index [0, 0, 2] is : C element at index [0, 1, 0] is : D element at index [0, 1, 1] is : E element at index [0, 1, 2] is : F element at index [1, 0, 0] is : G element at index [1, 0, 1] is : H element at index [1, 0, 2] is : I element at index [1, 1, 0] is : J element at index [1, 1, 1] is : K element at index [1, 1, 2] is : L
Example 2:
element at index [0, 0, 0] is : C++ element at index [0, 0, 1] is : Java element at index [0, 0, 2] is : C# element at index [0, 1, 0] is : Perl element at index [0, 1, 1] is : Python element at index [0, 1, 2] is : PHP element at index [1, 0, 0] is : GO element at index [1, 0, 1] is : Ruby element at index [1, 0, 2] is : F# element at index [1, 1, 0] is : JavaScript element at index [1, 1, 1] is : SQL element at index [1, 1, 2] is : kotlin
Note: For online compiler it is not possible to use 32-bit or 64-bit integer. Use offline compiler for 32 or 64-bit integer.