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

How to learn Azure without paid subscription

Microsoft Azure is a cloud service that is constantly expanding to help your organization meet business challenges. You can build, manage d...

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

Popular Posts