Collection Initialization Example in C#

Sample code snippet to demonstrate the Collection Initialization in C#.

Collection Initialization Example in C#

using System;

using System.Collections.Generic;

using System.Data;

using System.Linq;

namespace AbundantCode

{

internal class Program

{

//Collection Initialization Example in C#

private static void Main(string[] args)

{

List<string> ABundantCodeVersions = new List<string> { "Abundantcodev1", "Abundantcodev2", "Abundantcodev3" };

foreach (string versions in ABundantCodeVersions)

{

Console.WriteLine(versions);

}

Console.ReadLine();

}

}

}
Collection Initialization Example in C#