Inheritance: IEnumerable
Exemple #1
0
        static void Main()
        {
            var list1 = new LinkedList();
              list1.AddLast(2);
              list1.AddLast(4);
              list1.AddLast("6");

              foreach (int i in list1)
              {
            Console.WriteLine(i);
              }
        }
    static void Main()
    {
      var list2 = new LinkedList<int>();
      list2.AddLast(1);
      list2.AddLast(3);
      list2.AddLast(5);

      foreach (int i in list2)
      {
        WriteLine(i);
      }

      var list3 = new LinkedList<string>();
      list3.AddLast("2");
      list3.AddLast("four");
      list3.AddLast("foo");

      foreach (string s in list3)
      {
        WriteLine(s);
      }
    }