print list c# code example
Example 1: create List c#
using System.Collections.Generic
//type is your data type (Ej. int, string, double, bool...)
List<type> newList = new List<type>();
Example 2: recorrer list c#
if (this.lista is List<B>)
{
List<B> list_B = this.lista as List<B>;
foreach (B b in list_B)
b.Tarea();
}
else if (this.lista is List<string>)
{
List<string> list_S = this.lista as List<string>;
foreach (string s in list_S)
Console.WriteLine(s);
}