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 into it

Следи за CodeGalaxy

Мобильное приложение Beta

Get it on Google Play
Обратная Связь
Cosmo
Зарегистрируйся сейчас
или Подпишись на будущие тесты