Collection - Array

Arrays are references that point to fixed sizes of memory that you can store different kinds of elements in, such as values or references to other objects. In these examples, we look at simple examples of arrays.

Arrays is fixed number of memory allocate in system

It is initialize and with accessing with Square brackets []

Two dimensional array use comma with in bracket

How to create Array:

Int[] value=new int[Length]

// Int means data type suppose if you want string,bool,etc
// value is data type
// length means ,you can enter int value

Ex:

String val=new String[3];

Ex Program:

Using system;
Class Progra
{
//Public void button Click
Sting val=new String[3];
Val[0]="devenvexe";
Val[1]="Suthahar";
Val[2]="Suresh";
Foreach(string n in Val)
{
MesageBox.Show(n.Tostring);
}
}

0 Comments

Featured Post

Improving C# Performance by Using AsSpan and Avoiding Substring

During development and everyday use, Substring is often the go-to choice for string manipulation. However, there are cases where Substring c...

MSDEVBUILD - English Channel

MSDEVBUILD - Tamil Channel

Popular Posts