Example to demonstrate Collection Initializers in C#

Below is a sample code snippet demonstrating the usage of Collection Initializers in C#.

Example to demonstrate Collection Initializers in C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AbundantcodeConsole
{

    class Program
    {
        static void Main(string[] args)
        {
            // Example to demonstrate Collection Initializers
            List Input = new List { 1, 2, 3, 4, 5, 6 };
            foreach (var item in Input)
                Console.WriteLine(item);
            Console.ReadLine();

        }
    }

}