C# LinkedList GetEnumerator

Description

LinkedList GetEnumerator returns an enumerator that iterates through the LinkedList .

Syntax

LinkedList.GetEnumerator has the following syntax.


public LinkedList<T>.Enumerator GetEnumerator()

Returns

LinkedList.GetEnumerator method returns An LinkedList.Enumerator for the LinkedList.

Example


using System;//from  w w  w . j av a2 s.c om
using System.Collections;
using System.Collections.Generic;

public class GenericCollection  
{
   public static void Main()  
   {
      LinkedList<String> ll = new LinkedList<String>();
      ll.AddLast( "A" );
      ll.AddLast( "B" );
      ll.AddLast( "C" );
      ll.AddLast( "java2s.com" );
      
      LinkedList<String>.Enumerator e = ll.GetEnumerator();
      
   }
}




















Home »
  C# Tutorial »
    System.Collections.Generic »




HashSet
LinkedList
LinkedListNode
List
Queue
SortedSet
Stack