C# Array GetValue(Int64)

Description

Array GetValue(Int64) gets the value at the specified position in the one-dimensional Array. The index is specified as a 64-bit integer.

Syntax

Array.GetValue(Int64) has the following syntax.


[ComVisibleAttribute(false)]
public Object GetValue(
  long index
)

Parameters

Array.GetValue(Int64) has the following parameters.

  • index - A 64-bit integer that represents the position of the Array element to get.

Returns

Array.GetValue(Int64) method returns The value at the specified position in the one-dimensional Array.

Example

The following code example demonstrates how to set and get a specific value in a one-dimensional or multidimensional array.


using System;/*ww  w  .ja va2s .  co m*/

public class SamplesArray  {

   public static void Main()  {
      String[] myArr1 = new String[5];
      myArr1.SetValue( "three", 3 );
      Console.WriteLine( "[3]:   {0}", myArr1.GetValue( 3 ) );
   }

}

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version