Using the Action delegate : List : Data Structure C# Examples


C# Examples » Data Structure » List »

 

Using the Action delegate









    
using  System;
using  System.Collections;
using  System.Collections.Generic;
using  System.Collections.ObjectModel;
using  System.Text;

public  class  MainClass
{
        public  static  void  Main()
        {
                List<int>  intList  =  new  List<int>(new  int[]  {  3,  5,  15,  1003,  25  });
                
                intList.ForEach(delegate(int  x)  {  Console.WriteLine(x);  });

        }
}
    
   
  
   



Output

3
5
15
1003
25


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Structure
» List