CSharp examples for Language Basics:Array
Assign value to array
using System;/*from w ww .j av a 2s . com*/ class Program { static void Main(string[] args) { // declaring the size of the array string[] names = new string[4]; names[0] = "A"; names[1] = "B"; names[2] = "C"; names[3] = "D"; for (int i = 0; i < names.Length; i++) { Console.WriteLine(names[i]); // read the item at this index } } }