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

Understanding about Azure Region, Geographies, Availability Zones and Region Pairs

Introduction Microsoft Azure services are available in 53 regions around the world, with plans announced for 7 additional regions and 140+ a...

Subscribe to the FREE Weekly Newsletter to receive all the latest Microsoft Azure, AI, Xamarin

Popular Posts