What will be printed out as result of the following code execution?
 
       public static void Foo(params string[] lines)
       { 
           foreach (string l in lines) {  
                Console.Write(l);  
             } 
        }

        public static void Main() 
       {  
             string[] data = new string[] { "1", "2", "3" };     
             Foo(data); 
             Foo("A", "B", "C"); 
        }
 
Explanation
Foo method accepts undefined number of strings as parameters. Predefined array of strings can also be passed to it

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback