Implementing Iterator pattern of a single Linked List |  ; creating a list ; elements to be added at the end . in the above created list . ; elements of list are retrieved through iterator .
using System ; using System . Collections . Generic ; public class GFG { public static void Main ( String [ ] args ) { List < int > list = new List < int > ( ) ; list . Add ( 1 ) ; list . Add ( 2 ) ; list . Add ( 3 ) ; foreach ( int it in list ) { Console . Write ( it + " ▁ " ) ; } } }