params int[] args : Method Parameter : Class C# Examples


C# Examples » Class » Method Parameter »

 

params int[] args









    
using  System;

class  MainClass
{
    static  void  Main(string[]  args)
    {

        MyMethod(5,5,5,5);
      
    }
    
    static  public  void  MyMethod(params  int[]  args)
    {
        for  (int  I  =  0;  I  <  args.Length;  I++)
            Console.WriteLine(args[I]);
    }
}
    
   
  
   



Output

5
5
5
5


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Class
» Method Parameter