An Example of Collection Initialization

image_pdfimage_print
   
 


using System.Collections.Generic;
using System;
public class MainClass {
    public static void Main() {
        List<string> presidents = new List<string> { "AAAA", "BBBBBB", "CCCCCCCC" };
        foreach (string president in presidents) {
            Console.WriteLine(president);
        }
    }
}

    


This entry was posted in LINQ. Bookmark the permalink.